473,320 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

if then else - help please

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
2 1183
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christian Seberino | last post by:
I am looking at the ELSE home page and trying to figure out if I should invest the time to learn about the ELSE minor mode for Emacs. Is there any programmer out there using ELSE that is getting...
6
by: TuPLaD | last post by:
Hi, i got the following script: name = raw_input("Please enter your name: ") print "Your name is", name but i want it that way: if name = Stickie then
7
by: Gert Albertse | last post by:
I retrieve the recordset RS("SelectedMultiDisabilityEvent") form a table. The data type is text. When I run the next code: WHILE NOT RS.EOF Response.Write RS("SelectedMultiDisabilityEvent") &...
2
by: paul | last post by:
Hi all, I've been handed some code and, unless I've got the numbering of parentheses wrong, one of the functions has a curious if-else statement. The thing compiles but is it right? I know the...
3
by: divya | last post by:
Hiii, Please read the following piece of code:- function SendToWebServer1(sendto) //sendto string contains a URL { if (document.form1.txtbookedby.value == "") { alert('your name field...
2
by: pradeep.thekkottil | last post by:
I'm setting up an auction website using PHP and MySQL. There in the section where logged in members can put up new auction in a form, I want to run a form validation where I used if else statements...
4
by: Proaccesspro | last post by:
The code pasted below does not quite work as intended. I have a text box (txtSearch) on a form. Once the user enters a number (SSN) it willsearch for a match. One of the tests checks for a null or...
3
by: shror | last post by:
I was testing to post a form and echo message according to the submitted box using else if and then mail() the box result to myself just for testing the procedure but i got some problems: 1# the...
19
by: creative1 | last post by:
hi I am in strange problem. I have javascript for for validation. If I have any entry invalid it prompts me to corrrect it. All checks I have works fine. However, form does not response when there...
4
by: Twizted | last post by:
Hello, I am new to the forums and I have looked for solutions to this issue for two days now and I know it HAS to be something simple. I am trying to make an onclick for a table cell that will do...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.