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!

Go to record based on value from other form

Status
Not open for further replies.

helpplz

Technical User
Nov 10, 2002
6
US
I am trying to go to a record on one form based on a value from another form. I need help with the code. The below code is not working.

Function GotoCustomerAccount()

DoCmd.GoToRecord acForm, "frmCustomerInformation", acGoTo, Forms!frmCustomerInformation!CustomerID =
Forms!frmCustomerAccountLookup!CustomerID

End Function

Thank you in advance for the help.
 
Are you wanting to open the form filtered on that value or are you wanting to set focus to the new form and then filter to that value


jo
 
What I am trying to do is use a form, frmCustomerAccountLookup, as a search form. I already have my frmCustomerInformation form open, I click on a search icon to open the form frmCustomerAccountLookup. frmCustomerAccountLookup is a continuous form listing CustomerID, CustomerName, CustomerAccounts (the national account used by more than one CustomerID), and CustomerContact. When the user clicks on an icon relating to a line from the form frmCustomerAccountLookup, I would like the other form, frmCustomerInformation to move to that particular record. I could use a dropdown on the frmCustomerInformation form but it is easier for the user to see all the customer information in a long list when trying to pick the proper customer. When I use auto number for CustomerID the following code works unless a record is deleted from the customer information table:

Function GotoCustomerAccount()

DoCmd.GoToRecord acForm, "frmCustomerInformation", acGoTo, = Forms!frmCustomerAccountLookup!CustomerID

End Function

This is similar to the code I first showed except the frmCustomerInformation form moves to the record number equal to the CustomerID number from the frmCustomerAccountLookup form. Again this will work unless a record gets deleted from the customer information table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top