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.