Reset number back to 1

BoroLee

Registered User.
Local time
Today, 11:55
Joined
Aug 30, 2000
Messages
90
I have a form with the following fields:

ID, EventID, ContactID, BookingID

the Event ID is a default value takem from the previous form, the ID is an autonumber and Primary, and the ContactID is selected using a combo box.

Wot i want to do however, is to reset the BookingID number back to 1, each time there is a new event number, and then increment this number by 1 as delegates are added.

Help muchly appreciated.
 
Compact the Db, this will reset the autoNumber.
 
That's not what i'm trying to say.

As time goes by, new events will be added. Wot i want to do is reset the Booking number to 1 each time this happens
 
You need some way of detecting a new event number. You set the default to be a previous value, so when you change the value in the event number field, you need to test if th event number is a new number. You can do that easily using a Dcount function. Then use a DMax function to find the last assigned delegate number and increment it by 1 to get a new number.
 
Any code examples wpould be much appreciated as i'm trying to teach myself VBA
 
Do you know how to assign code to an event? If not, check out the basic VBA topics in the Access on line help.

What code/procedure are you using to take the event number from the previous record?
 
i'm ok doing basic code stuff on the On Open, On Click events etc.

Wheni open the FrmDelegate, the defualt value in the EventID is linked to the frmEvent which is the previous form
 

Users who are viewing this thread

Back
Top Bottom