423,850 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,850 IT Pros & Developers. It's quick & easy.

if then else - help please

P: n/a
hi,

hopefully an easy one for someone.

how do i specify two sets of critera in an if statement

for example

if isnull(me.txt27) and me.txtfld = "4" then

msgbox "You must enter a serial number"

end if

i just cant get this work..
thanks
Lee-Anne

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try replacing the dot after me with a bang (!).

Is txtfld a string data type? If it is number, remove the quotes.

Otherwise, what you have should work!

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Lee-Anne Waters via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:4f******************************@AccessMonste r.com...
hi,

hopefully an easy one for someone.

how do i specify two sets of critera in an if statement

for example

if isnull(me.txt27) and me.txtfld = "4" then

msgbox "You must enter a serial number"

end if

i just cant get this work..
thanks
Lee-Anne

--
Message posted via http://www.accessmonster.com

Nov 13 '05 #2

P: n/a
You haven't specified in what way it doesn't work.
Have you tested each criterion by itself, so that you know that the problem
lies in using them together?
For example, many textboxes which appear empty actually contain a blank
string, so they fail the IsNull test.

"Lee-Anne Waters via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:4f******************************@AccessMonste r.com...
hi,

hopefully an easy one for someone.

how do i specify two sets of critera in an if statement

for example

if isnull(me.txt27) and me.txtfld = "4" then

msgbox "You must enter a serial number"

end if

i just cant get this work..
thanks
Lee-Anne

--
Message posted via http://www.accessmonster.com

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.