Hi,
I am creating a form for invoice input. This includes a textbox for customer number (tbxCustomerNo) and a read-only textbox (tbxCustomerName) for customer name.
I have a DLOOKUP function in the onexit event of tbxCustomerNo to look up for the customer name from a table. If found, the customer name from the table will be set to tbxCustomerName.text. Otherwise a message box will pop up for a error message and tbxCustomerNo will get focus to force user to enter again.
Of course, there are 2 buttons on the form: btnSave and btnCancel.
The DLOOKUP function run exactly what I want. But when the user entered something the DLOOKUP function cannot found, it forced to stay in tbxCustomerNo even I click the btnCancel.
Seems that the tbxCustomerNo.onexit event do what it should be but it is logically wrong when I click the btnCancel.
What can I do to allow the user to click btnCancel when they had entered something in tbxCustomerNo?
I am creating a form for invoice input. This includes a textbox for customer number (tbxCustomerNo) and a read-only textbox (tbxCustomerName) for customer name.
I have a DLOOKUP function in the onexit event of tbxCustomerNo to look up for the customer name from a table. If found, the customer name from the table will be set to tbxCustomerName.text. Otherwise a message box will pop up for a error message and tbxCustomerNo will get focus to force user to enter again.
Of course, there are 2 buttons on the form: btnSave and btnCancel.
The DLOOKUP function run exactly what I want. But when the user entered something the DLOOKUP function cannot found, it forced to stay in tbxCustomerNo even I click the btnCancel.
Seems that the tbxCustomerNo.onexit event do what it should be but it is logically wrong when I click the btnCancel.
What can I do to allow the user to click btnCancel when they had entered something in tbxCustomerNo?