View Full Version : Help with two forms


ATB
12-06-2001, 08:12 AM
I have a form which shows me my chosen customers details and a subform listing all jobs performed for the customer. You select the job in question from the list and this opens a 2nd for giving details of the job. This works well until i want to add a new job. as soon as the 2nd form moves to a new record it resets the customer id field back to 0 and i have to retype the correct customer ID for the update to work. My question is how can i make this field use the current customer id for new recoords.

Thanks

Jack Cowley
12-06-2001, 08:37 AM
If the first form remains open with the CustomerID you want then in the new form you can put code like this in the On Current event:

If Me.NewRecord Then
Me.CustomerID = [Forms]![Form1Name]![CustomerID]
End if

ATB
12-07-2001, 02:05 AM
Thanks, but can't seem to get this working.

The 1st form does remian open but not active, does this matter? I have put the code but still doesn't seem to post the customer id in the field when adding a new record. Any other idea's

Cheers