DS,
I am fishing because I don't know enough about the specific Access
application you support. But constraints are a standard part of the design
of the database. You enable them by establishing relationships between
tables in Access and then enabling referential integrity for the
relationship. Check out the help files on Relationships as a start.
As for trapping error messages generated by Access this can be simple or it
can be complex. Initially you need to create code in VB which will catch
the error when it occurs and substitute your message for the one Access
generates. Before I changed careers and returned to being an amatuer
programmer instead of a paid one I had my own event trapping code that used
a table which listed all the error codes with my own error messages. This
way I could change the error messages to suit the customer.
"DS" <bo******@opton line.net> wrote in message
news:S1******** *************@n ews4.srv.hcvlny .cv.net...
Alan Webb wrote:
Not a macro. Set up a referential integrity constraint in the references
window.
"DS" <bo******@opton line.net> wrote in message
news:gc******** ************@ne ws4.srv.hcvlny. cv.net...
How does one set-up a macro to do the following. When you enter an
Employee Number in a log-in box Access checks the Employee Table to see
if thats a valid Employee number. if it is the Macro continues along its
way, if not it gives a message box saying that "This is not a valid
Employee ID"
DS
PS the field that the ID Numbers are typed into is an unbound field that
sends the number to a record in another form. A default message comes up
from Microsoft that I really don't want so I guess its kind of working. I
just want it to be cleaner and slicker. Thank you once again.
DS