So I've built a data entry form for a job tracking database. I've been asked to make the textbox for entering the job number give an error message if that job number already exists in the database. (before anyone says it, I'm also using autonumber for the primary key)
I was thinking I could use the OnChange event and run a query with the VBA and then use IF ELSE to check whether that query came back null or with a match to what's in the text box. IF it matches the textbox I would use a msgbox and set focus back to that textbox.
I'm not entirely sure how the result from the query comes back into the code, or how I should call the query. Any other help with how I'm thinking this should work would be appreciated as well.
I'm getting there slowly.