Getting stuck on text box with control source

G

Guest

Hello there,
I'm working on the finishing touches on a productivity database!!! The one
"bug" I don't like is users getting stuck when they input an invalid employee
id # on the main form. I want the text box to only allow valid values found
in the associate table, but if they don't I'd like to have it prompt them to
update the emp id or just not save the record. Right now it just keeps
repeating the same error msg "The Microsoft Database Jet Engine can not find
a record in table 't_associates' with key matching field(s) 'Employee Id'. "


thanks for any help! I ran a search but can't quite find anything with this
topic : )
 
G

Guest

Where are you doing the validation? Is it a Validation Rule at the table
level, a Validation Rule at the control level, or do you have code in the
Before Update event of the control?
My guess is that it is a Validation rule. This is why I never use them.
You have almost no control over them. If that is the case, I suggest you
remove the validation rule, and create code in the Before Update event of the
text box, and code it such that the user has a way out.
 
G

Guest

I think you bettter use a combo box for the empid, have its rowsource
property to your t_associates table. include two columns(fields) in the quey
design, the Empid field and Name maybe. set the no of columns of ur combo
box to 2, set the widths to 0;2 so that the name will be visible and the
bound column is 0; this will be more versatile than using textbox.
 
G

Guest

Thanks for the recommendation - can you help me with the code here? I'm a
novice at VBA code so any help would be appreciated. I like this idea b/c I
don't want users to be able to scroll through other users emp id's - I want
them to have to type in the value.

thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top