View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed[_31_] Ed[_31_] is offline
external usenet poster
 
Posts: 34
Default User Forms & Checking Inputs

Jez,

Put the code needed to check the job number in the function

Private Sub txtJobNum_Change()
' code to check the value
End Sub

This goes in the code for the user form. txtJobNum is the name of the
text box on the form. You will have to
devise code to not allow the form processing to complete until the
user corrects the situation. For example,
you could throw up a msgBox with OK and Cancel buttons. But a better
solution would be to give the
user the next available job number rather than having him/her guess.
Search the DB for the largest one
already there and write that number plus 1 into txtJobNum as the
default value.

Ed


"Jez" wrote in message
...
Hi please help...

I have a user form in Excel which collates all the information I
need, and
then updates into a table in an access database.

I am trying to understand that when I input a job number in the form
that it
then runs a query to the database and finds out if that job number
exists in
the table already, and if so then it alerts me to say allready in
database.
How can I do this?