Searching for a specific client.

Dazzla

Registered User.
Local time
Today, 18:58
Joined
Nov 5, 2004
Messages
23
I have a form where i can enter a clients payroll number and click the search button. This will then give me their details. Is there anyway i can make it show an error message if:-

1. They dont enter a payroll number and click search
2. They enter an invalid Payroll Number and click search.
 
You can put the code

Code:
 If IsNull( etc etc

on the search button to make sure something is in the field

and 2

you could use an input mask to make sure they get the format right

Col
 
Thanks the first part would work, but i dont think an input mask would help. What if someone just typed the payroll number wrong by One Digit. I need an error message to appear saying "Incorrect Payroll number" then prompt the user to enter the number again.
Hope this is clear
 
If the payroll number is in the correct format then Access won't know if its right or wrong.

You could have a MessageBox come up and say "You entered number xyz12234 - is this correct?" Yes or No

If Yes Then carry on - If No Then exit and go to the payroll field again.

Col
 
Use a combo box and then users can be prevented from entering invalid numbers
 
Thought about that, but theres nearly 3000 records. Could do with some kind of if statement on the command button, but not to clued up on VB
 
The limit for combo boxes is approx. 64K and will still be faster than a DLookUp
 

Users who are viewing this thread

Back
Top Bottom