Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking forms via fields

Status
Not open for further replies.

JGood

Technical User
Aug 8, 2002
2
US
I am creating a db in Access 2000. The code below is part of an "on click" for a button on Form1, which is supposed to open Form2 (it does) and go to the record for the same individual that Form1 is open to (it does not). I've tried everything, including writing the same thing as a Macro (which doesn't work), and letting the Wizard create the code for me (which, once complete, also doesn't work). I've even gone to the trouble of installing my private copy of Access XP on my work computer, hoping that it would solve the problem, but I have had no more luck with that version. Here's the code that I'm trying to use:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Employer Form"

stLinkCriteria = "[FileNumber]=" & Me![Participant]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Has anyone else had this problem? What can I do to get this code to open the proper record in the 2nd form?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top