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

Macro to Open Form and go to specific record

Status
Not open for further replies.

sawilliams

Technical User
Aug 23, 2006
98
US
I have a macro that creates a new record and then opens the form to display the records. The form opens to the first record. I want it to open to the record I just created. In the "where condition" of the open form step in the macro I tried a variety of methods to make [tblCustomer]![CustID] or [frmCustomer]![CustID] equal the last ID created but I have failed. If I write [tblCustomer]![CustID] = 821, the form opens and displays customer #821. But I can't get what I need to input to get the last customer created. I even wrote a query to give me the maxOfCustID and make [tblCustomer]![CustID] = [qryCustID]![maxOfCustID] but I just get a parameter prompt. So, what do I do now?
 
try sql statement with last method

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top