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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Go to record based on a value from other form

Status
Not open for further replies.

helpplz

Technical User
Joined
Nov 10, 2002
Messages
6
Location
US
This is a repost. If anyone knows the solution to this problem please let me know. I thank you for you time and knowledge.
thread705-408805
 
Hallo,

I think I see the problem. Your previous thread had:
Code:
DoCmd.GoToRecord acForm, "frmCustomerInformation", acGoTo, Forms!frmCustomerInformation!CustomerID = 
Forms!frmCustomerAccountLookup!CustomerID
When the Forms!... references are interpreted by the machine this would give:
Code:
DoCmd.GoToRecord acForm, "frmCustomerInformation", acGoTo, 28 = 124
Obviously that's not going to work. What you need to do is:
Code:
DoCmd.GoToRecord acForm, "frmCustomerInformation", acGoTo, "CustomerID = " &  
Forms!frmCustomerAccountLookup!CustomerID
(Assuming the code is in frmCustomerInformation)

This would then be interpreted as:
Code:
DoCmd.GoToRecord acForm, "frmCustomerInformation", acGoTo, "CustomerID = 124"

Which is much better. Hope that helps,

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top