Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull number from one table into another????

Status
Not open for further replies.

Hargreavesk

Technical User
Jul 18, 2001
97
GB
Hi,

I am currently developing a Cheque Writing facility. Instead of AutoNumber, I have all my numbers in a table. What I would like to happen is that each time a cheque input form is opened it takes the first number from my table and then moves it to the bottom of the table. The reason for this is that only 5000 cheque numbers are used and then the number reverts back! Is there a way of doing this or is it a no-go?

Any help would be appreciated.

Yours desperately

Kate
 
What about just having a simple table with one record in it like:-
tblNextCheque containing a fldNextCheque

Then, when the form opens

Open record Set looking at that table with Pessimistic Locking
Set local variable to value of the fldNextCheque
If value = 5000 Then
Set value in recordset = 0001
Else
Increment value in recordset
End IF
Check that the value < 5000
recordset.Update
recordset.Close

Use local variable in the form.


'ope-that-'elps

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top