Access 101 question from a beginner!
Very simply, I want to create a data entry form that allows lookup of a specific unique key as entered by the user, displays the associated record from the table, and allows a user to edit the data of the record. What I don't know how to do is allow the user to enter a value for the unique index key and retrieve the associated record to display on the form, or if not found, generate a message. For example, enter a customer account number (unique key), look up the customer record, display it and allow the address to be modified.
This seems so simple but I can't find examples or references anywhere. Currently, I have the form with the bound controls and one unbound text control as the first control that allows entry of the key data. I call a macro upon exit of that control, the macro runs OpenQuery to a query on the control data, and Close, but the form wont display the record of the matching key. It always displays the first record of the table.
I am obviously going about this wrong, can anyone offer some insight?
Thanks,
SHallman
Very simply, I want to create a data entry form that allows lookup of a specific unique key as entered by the user, displays the associated record from the table, and allows a user to edit the data of the record. What I don't know how to do is allow the user to enter a value for the unique index key and retrieve the associated record to display on the form, or if not found, generate a message. For example, enter a customer account number (unique key), look up the customer record, display it and allow the address to be modified.
This seems so simple but I can't find examples or references anywhere. Currently, I have the form with the bound controls and one unbound text control as the first control that allows entry of the key data. I call a macro upon exit of that control, the macro runs OpenQuery to a query on the control data, and Close, but the form wont display the record of the matching key. It always displays the first record of the table.
I am obviously going about this wrong, can anyone offer some insight?
Thanks,
SHallman