synchronizing two forms of the same table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to conditionally synchronize two forms of the same table in Access
2003. I should like to open form1, choose a record and switch to the other
form2 which should show the same record. By means of a command button, form1
should close and form2 open showing the record that form1 displayed. Both
forms have some of the same control and field names, but display different
information. Thanks for your help...

JTW
 
Hi, JTW. The general approach to opening another form and closing the first
one is:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "YourForm2Name"

stLinkCriteria = "[YourLinkingFieldName]=" & Me![YourControlNameOnForm1]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "YourFirstFormName", acSaveYes

See VBA Help on the Close method for additional values of the parameters.

Hope that helps.
Sprinks
 
Back
Top