View Full Version : Increment a field number in a subform


johnhobbis
04-12-2001, 08:45 AM
I have a subform with a field called "Visit_Number" the subform has a related childfield to the masterform
OutreachID Master(autonumber)
OutreachID child.

I need to add a record to the subform that keeps the current OutreachID (master) this works ok.
BUT I need the Visit_Number field to increment by one if a new record is added in the subform. I cannot use an auto number on the subform table because there may be more then one instance on the subform of the MasterID.

Anyone got any idea how i can increment the Visit_Number by 1 every time a record is added in the subform.

john

Carol
04-12-2001, 01:56 PM
Set your OutreachID field to increment by 1 based upon your OutreachID Master field using the DMax function. If you require further help - write back.

johnhobbis
04-12-2001, 03:09 PM
Hi Carol

The OutreachID on both Master and Child (subform) are ok. But when i add a record to the SubForm i need the Visit_Number to increment by one for every record added to the SUB FORM.

Can send you over a screen shot of form if you like.

johnhobbis
04-12-2001, 03:21 PM
Hi Carol

The OutreachID on both Master and Child (subform) are ok. But when i add a record to the SubForm i need the Visit_Number to increment by one for every record added to the SUB FORM.

Can send you over a screen shot of form if you like.

johnhobbis
04-12-2001, 03:39 PM
Carol,

Am mailing you a screen shot and details,

The outreachid are ok . i just need to increment the Visit Number in the Sub Form for a patient visit the sub form might have a number of the same outreachID (patient number) depending on the number of visits.