Form to search for record

paulhenley

Registered User.
Local time
Today, 06:27
Joined
Apr 16, 2002
Messages
23
I have created a form that prompts the user to enter a contract number. This then searches the contract table and opens up another form (contract) with all of the contract details ready for amendment. The problem that I have is that if the contract number entered does not exist, it opens up the contract form anyway as a new record. I would like a message box to prompt the user that the contract number enetered does not exist and therefore not open the contract form.

Please can anyone help?
 
Set the "limit to list" property on the combobox to Yes. Then, on the NotInList event for the combobox, you can have code that pops up a msgbox saying "This contract does not exist. Do you want to add?"

Then if the user selects Yes, you write code that opens a data entry form to add the contract details, etc.

Then, when the user finishes entering the data on the data entry form, and closes the form, have the combobox on your original form requery so that it will show the contract just entered.

If you need details about coding this, let me know and I'll send you some that I usually use.
 

Users who are viewing this thread

Back
Top Bottom