tp Sequential Counting?

T

Tom

I have a control "RunNumber" that is set to count sequentially by 1, every time
a new record is entered via a command button. This works fine. When I click
on the button, a new record comes up, and the next number is in the control.

Here is the event procedure:

Private Sub Command85_Click()
DoCmd.GoToRecord , , acNewRec
Me.RunNumber = Nz(DMax("[RunNumber]", "ABLE_Table1", "[RunDate]=Date()"), 0)
+ 1
Me.Dirty = False

End Sub

Here is the 1st problem, and only one I'm addressing now.
This should start at "001" when opening the program, or when the date
changes at midnight. Haven't checked the date change at midnight yet.
Right now it always starts at "000". If the program is closed for any reason,
or the system goes down, it always picks up at "000". It should pick-up
where it left off if the system goes down. i.e. if last record was "056"
when the program is closed or the system goes down, then when opening the
program it should have a new record with the number "057" in the RunNumber
control.
It ain't doin' it.

Any thoughts?
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top