I hope I understand this. Please flesh out your problem more clearly if I get this wrong.
The assumption is:
You want to open a form with the right data showing on the form for a specific person. You don't want to open a form and use the record navigation buttons on the bottom of the screen.
When you open the form you can choose parameters of the forms query back end. I'm assuming your form has its own record set if you use the navigation buttons.
Alot of assumptions
Change the action where you open the form using 1 of 2 techniques. Using the
where or
filter arguments of the openform command, or using the
openargs argument. Look these up help if you need more information on how to use them (in Access Help). Here are some examples.
In the case where you have a query back end or recrodset for your form.
This will limit the value of the form you open to coincide with your customerID, substitute the appropriate name of your field. (using the where clause).
DoCmd.OpenForm "THE FORM YOU WANT TO OPEN", acNormal, ,"customerID = " & (the customer id) , ,
If you don't have a query based form you can use the openargs parameter (the next example)to pass whatever information you want to the for you are opening and then in your form_open method you can use something to look up all the data you might need.
DLookup() is a good example.
DoCmd.OpenForm "THE FORM YOU WANT TO OPEN", acNormal, , , , , (the customer id)
Roni Estein
[email protected]
https://www.e-drugsCanada.com