Reference

40 pts.
Tags:
Development
Increment
Iam trying to write a formula that will increment by one each time the same "form" is opened. I was going to use the day and month then add one eg 030401 then the next time the form is opened it will show 030402, however I will be happy with just any number just to understand how to increment
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Lamy
You may use the following procedure :
1) Create a table (tblFormCount) with the basic 2 fields –
FormID text (with whatever size you want) – primary key
FrmCount long integer (to hold the number of times a form is opened)
and any other fields you may require (eg. Now())
2)Create a module with :
Function FrmCount (W_FrmID as string)
Opendataset tblFormCount
Use the primary key as the index to access the required record from the table,
If the key is not matched then you can add a new record with the form id, and FrmCount = 1
else
Edit the table
increment the frmCount by 1
Update the table
close the dataset
3)When you Open the form execute the function FrmCount(form name)
Hope this will work, if you have any question dont hesitate to e-mail me
Good Luck
Amr

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: