Jump to content
Sign in to follow this  
jbj

Incrementing serial number in a simple accountancy database

Recommended Posts

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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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?

;)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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