How do I link 2 forms in Access?

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

Guest

I basically have 3 forms, 1 is a switchboard which you click a command button
and it takes you to page 1. I then have another command button to take you to
page 2, I did exactly the same event proceedure but changed the name of the
form but it didnt work?
 
Sunnystar,

Please post your code and we can help. In general, to open a form,
displaying all data in the underlying RecordSource, the code is:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "YourFormName"
DoCmd.OpenForm stDocName

To filter the 2nd form by the current record of the first form, the code is:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "YourFormName"

stLinkCriteria = "[FieldOfSecondForm]=" & Me![ControlOnFirstForm]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Sprinks
 
Back
Top