Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Incrementing serial number in a simple accountancy database


This topic is 6245 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I am trying to build a simple database to keep account of bank transactions.

I have two tables: "TTransactions" and "TRegister"

From the table "TRegister" I plan to create new records in "TTransactions".

I have set up a relation between the two that seemingly works fine.

I have created a portal in "TRegister" for creating records in "TTransactions". This portal shows the following flds in this order:

"Bnr", "Date", "Accountnr", "Txt", "Debet", "Kredit" (left to right in the portal)

The fld "Bnr" in "TTransactions" creates a serial number for each bill (document) to be registered (on creation).

Then I have a calculation fld called "Balance" in "TRegister" that calculates the balance between the two fields "debet" and "kredit" in the portal related to "TTransaction".

On creation of new record in "TTransactions" I want to keep fld "Bnr" the same if fld "Balance" is not 0-zero. If the result is 0, then the serial nr of fld "Bnr" should increment by 1.

How can I get this result on committing the last fld "kredit" of the last record in the portal?

I would very much appreciate the help from some expert out there! Thank you!

Link to comment
Share on other sites

I would strongly not recommend that you do not try and go down this path. Each record should have a serial key as a unique id.

Link to comment
Share on other sites

  • Newbies

Thank you for your trouble trying to understand my problem!

May be you are quite right. I am sorry I might not have made myself quite clear.

1. Each transaction has individual serial number. The fld "Bnr" is another reference number to each document registered. When registering one document, you might have to have for example 1 debet transaction and occasionally several kredit transactions, i.e. not always only 1 debet and 1 kredit. Therefore two serial or reference numbers are needed.

2. One important concern is how to make things happen when committing data in a field, for example when leaving the last field in the last portal row (the fld "Transactions::Kredit")

I think this must be possible, but I have not found any way yet...

May be you have some more advice?

;)

Link to comment
Share on other sites

This topic is 6245 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.