synchronizing two forms of the same table

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top