Checking a condition

D

Derek

I'm trying to check the following condition:
If me.txtbx.value = "X" and me.txtbx isnull then msgbox.

I'm not sure how to code it, I thought I was close but it
doesn't like the "and" or the "isnull". The second is
what would be the sytax for the msgbx.

Thanks
 
F

fredg

I'm trying to check the following condition:
If me.txtbx.value = "X" and me.txtbx isnull then msgbox.

I'm not sure how to code it, I thought I was close but it
doesn't like the "and" or the "isnull". The second is
what would be the sytax for the msgbx.

Thanks

Iif Me![Control1] = "X" and IsNull([Control2]) Then
MsgBox "Condition met"
etc.
End If
 
D

Derek

Great
Now if I put this in the "Beforeupdate" event, and I want to halt the update and throw them to control 2, how would I go about that?
 
P

PC Datasheet

Iif Me![Control1] = "X" and IsNull([Control2]) Then
MsgBox "Condition met"
etc.
Else
Cancel = True
Me![Control 2].SetFocus
End If


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com




Derek said:
Great.
Now if I put this in the "Beforeupdate" event, and I want to halt the update
and throw them to control 2, how would I go about that?
 

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