Linking Forms - Same Record

StacyStacy

A "Californian" at heart!
Local time
Today, 16:51
Joined
Jan 29, 2003
Messages
159
How do you create 2 forms (without using tabs) that is linked to the same record?

Example, instead of creating 1 long form, I would like to create 2 forms, having a button that opens the 2nd form and staying on the same record that you were in on the 1st form. i.e. if I were on record #20 on the first form and pressed the button to open the second form, I still want to be on record #20, not record #1.

Thanks,
 
When you open a form, you typically use the DoCmd.OpenForm command. That command has several parameters, including a "WHERE" parameter, and an OpenArgs parameter.

The "Where" parameter is just like a SQL statement, without the "Where" word. For example:
DoCmd.OpenForm "myform",,,"[ID]"=Me.ID
will open up the form "myform" and move to the record where the ID field is equal to the ID field on the current form.

The OpenArgs parameter works similarly as is described in the Access on-line help.

FYI: After you open the 2 forms, if you want to keep these forms synched to showing the same record, that's possible also using the On Current events of the forms.
 

Users who are viewing this thread

Back
Top Bottom