Text Box validation in a form on OnExit or OnLostFocus
Text Box validation in a form on OnExit or OnLostFocus
(OP)
I need to create a macro or a code to check if data entered in the txtCase Text Box of frmContacts exists in a Clients table.
Should I use OnExit or OnLostFocus events?
Should I use OnExit or OnLostFocus events?
RE: Text Box validation in a form on OnExit or OnLostFocus
RE: Text Box validation in a form on OnExit or OnLostFocus
I just realized I was not precise enough when I was writing my questions. I forgot you guys are professionals.
1. The reason I did not use a combo box is that I have more than 13.000 unique case numbers in the Clients table (does it matter?).
2. The Contacts for is rather big and I would like to stop the validation process sooner to save some time for a data entry clerk; that was the reason I was thinking of something else instead the Before Update event.
3. I do not know any other way how (beside a combo box) to resolve this.
RE: Text Box validation in a form on OnExit or OnLostFocus
Other alternatives:
1) set up a 1:many relationship with referential integrity. This will not allow you to add a record to the child table that doesn't exist in the parent table.
2) use the DLookup function to look for the client number.
3) use a form with the Clients table as the main source and your child table as the subform. Have the user select the client form the existing table before entering the info.