Hi Richard. I am trying to create an Employee Search form where my users can search for an employee by employeeID or LastName & FirstName. I have tried this code: DoCmd.OpenForm "EmployeeF", , , "EmployeeID=" & EmployeeID and it is not working. What am I doing wrong? It will not let me type in an employee # in the EmployeeID field, and if I type a LastName/FirstName, it creates a new file in the employeeT...
Reply from Richard Rost:
If your search form BOUND to your employee table? Make sure there's nothing listed in the form's RECORDSOURCE property. This needs to be an UNBOUND form. The fact that you can't type an ID tells me it's picking up the AutoNumber (which you can't edit) from the underlying table... and if you're getting a new record when you type in a name, that means the data is being saved to the table.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Microsoft Access 302.