if box x is empty then display message

shutzy

Registered User.
Local time
Today, 17:08
Joined
Sep 14, 2011
Messages
775
the question is in the title really. i want to display a message box if [EmployeeListID] is empty.

ive tried
If [EmployeeListID] IsNull()
MessageBox .............

it dosnt like this and i dont really know what i am doing yet with IsNull Expression.

can anyone help
 
Try looking at Access for help with this type of thing. You learn more when you discover the answer yourself.

Code:
   If IsNull ([Me.EmployeeListID] Then
        MsgBox = "Hello World"
   End If

But I would prefer

Code:
    If Len ([Me.EmployeeListID] = 0 Then
       MsgBox = "Hello World"
    End If
 
thanks. ive never really used the help section of any of the office applications, not really felt they give as good an answer as a forum.

i have only just managed to do it just as you replied.

macro
If IsNull([EmplyeeListID])
messagebox........

seems to be what it is after.

thanks for your reply
 
Question.

Is "EmployeeListID" a Primary Key, a Foregin Key or is it something completely different.
 
its the unique id for the table.

it on a form. i have a button that takes you to another form but i want certain info before they can proceed. when the form opens the employee combo box is blank and i want to know which employee it is book under. its an appointment booking system
 
That being the case, there should be no need to check. The record won't save without an ID.
 
ye i appreciate that. its not actually saving a new record on that table. its saving a new appointment record with various other things.
 
You appear to be happy with what you are doing so I will leave it there except to say that there are other options that may be more suitable.

Cheers and all the best with the project.
 

Users who are viewing this thread

Back
Top Bottom