PC Review


Reply
Thread Tools Rate Thread

syntax question (Not Equal to?)

 
 
Grace
Guest
Posts: n/a
 
      4th Feb 2004
In the code below, I would like the msg box to appear if
the [CallStatus] field is not equal to "Closed". I just
don't know the syntax for "not equal to"!

If [CallStatus] not equal to "Closed" And IsNotNull
([Closedby]) Then
MsgBox "You must change the Call Status to Closed.",
vbOKOnly
[CallStatus].SetFocus
Cancel = True
End If

Thanks for your help
 
Reply With Quote
 
 
 
 
Karl
Guest
Posts: n/a
 
      4th Feb 2004

>-----Original Message-----
>In the code below, I would like the msg box to appear if
>the [CallStatus] field is not equal to "Closed". I just
>don't know the syntax for "not equal to"!
>
>If [CallStatus] not equal to "Closed" And IsNotNull
>([Closedby]) Then
> MsgBox "You must change the Call Status to Closed.",
>vbOKOnly
> [CallStatus].SetFocus
> Cancel = True
>End If
>
>Thanks for your help
>.
>I would use "<>".

 
Reply With Quote
 
 
 
 
Cheryl Fischer
Guest
Posts: n/a
 
      4th Feb 2004
Try ...

If [CallStatus] <> "Closed" And Not IsNull ([Closedby]) Then
...<rest of code>


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


"Karl" <(E-Mail Removed)> wrote in message
news:970301c3eb2c$cf2e9210$(E-Mail Removed)...
>
> >-----Original Message-----
> >In the code below, I would like the msg box to appear if
> >the [CallStatus] field is not equal to "Closed". I just
> >don't know the syntax for "not equal to"!
> >
> >If [CallStatus] not equal to "Closed" And IsNotNull
> >([Closedby]) Then
> > MsgBox "You must change the Call Status to Closed.",
> >vbOKOnly
> > [CallStatus].SetFocus
> > Cancel = True
> >End If
> >
> >Thanks for your help
> >.
> >I would use "<>".



 
Reply With Quote
 
Grace
Guest
Posts: n/a
 
      4th Feb 2004
Ok, thanks for the syntax information. Now I am having
another problem, I would like the code to check 2 things.
The first part of the code (where [CallStatus]="closed")
works great, but I would also like it to check if the
Closedby field is NOT null and the [CallStatus] field is
not equal to "Closed" then bring up an error message. I
am getting a compile error on the ElseIf. I assume I am
not writing this correctly. (Can you tell my VBA
knowledge is lacking??!!)

If [CallStatus] = "Closed" And IsNull([Closedby]) Then
MsgBox "You must enter the Closed By information.",
vbOKOnly
[Closedby].SetFocus
Cancel = True

ElseIf [CallStatus] <> "Closed" And IsNotNull
([Closedby]) Then
MsgBox "You must change the Call Status to
Closed.", vbOKOnly
[CallStatus].SetFocus
Cancel = True
End If

End If


Thank you,
Grace
>-----Original Message-----
>
>>-----Original Message-----
>>In the code below, I would like the msg box to appear if
>>the [CallStatus] field is not equal to "Closed". I just
>>don't know the syntax for "not equal to"!
>>
>>If [CallStatus] not equal to "Closed" And IsNotNull
>>([Closedby]) Then
>> MsgBox "You must change the Call Status to Closed.",
>>vbOKOnly
>> [CallStatus].SetFocus
>> Cancel = True
>>End If
>>
>>Thanks for your help
>>.
>>I would use "<>".

>.
>

 
Reply With Quote
 
Cheryl Fischer
Guest
Posts: n/a
 
      4th Feb 2004
Hello Grace,

I believe the problem in the following line:

ElseIf [CallStatus] <> "Closed" And IsNotNull ([Closedby]) Then

is that there is not a function named IsNotNull().

How about trying the following:

ElseIf [CallStatus] <> "Closed" and Not IsNull([Closedby]) then


hth and let us know...
--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


"Grace" <(E-Mail Removed)> wrote in message
news:a3be01c3eb3d$4a5e43d0$(E-Mail Removed)...
> Ok, thanks for the syntax information. Now I am having
> another problem, I would like the code to check 2 things.
> The first part of the code (where [CallStatus]="closed")
> works great, but I would also like it to check if the
> Closedby field is NOT null and the [CallStatus] field is
> not equal to "Closed" then bring up an error message. I
> am getting a compile error on the ElseIf. I assume I am
> not writing this correctly. (Can you tell my VBA
> knowledge is lacking??!!)
>
> If [CallStatus] = "Closed" And IsNull([Closedby]) Then
> MsgBox "You must enter the Closed By information.",
> vbOKOnly
> [Closedby].SetFocus
> Cancel = True
>
> ElseIf [CallStatus] <> "Closed" And IsNotNull
> ([Closedby]) Then
> MsgBox "You must change the Call Status to
> Closed.", vbOKOnly
> [CallStatus].SetFocus
> Cancel = True
> End If
>
> End If
>
>
> Thank you,
> Grace
> >-----Original Message-----
> >
> >>-----Original Message-----
> >>In the code below, I would like the msg box to appear if
> >>the [CallStatus] field is not equal to "Closed". I just
> >>don't know the syntax for "not equal to"!
> >>
> >>If [CallStatus] not equal to "Closed" And IsNotNull
> >>([Closedby]) Then
> >> MsgBox "You must change the Call Status to Closed.",
> >>vbOKOnly
> >> [CallStatus].SetFocus
> >> Cancel = True
> >>End If
> >>
> >>Thanks for your help
> >>.
> >>I would use "<>".

> >.
> >



 
Reply With Quote
 
Grace
Guest
Posts: n/a
 
      4th Feb 2004
That worked GREAT!! Thanks so much.

Grace
>-----Original Message-----
>Hello Grace,
>
>I believe the problem in the following line:
>
> ElseIf [CallStatus] <> "Closed" And IsNotNull

([Closedby]) Then
>
>is that there is not a function named IsNotNull().
>
>How about trying the following:
>
> ElseIf [CallStatus] <> "Closed" and Not IsNull

([Closedby]) then
>
>
>hth and let us know...
>--
>
>Cheryl Fischer, MVP Microsoft Access
>Law/Sys Associates, Houston, TX
>
>
>"Grace" <(E-Mail Removed)> wrote in

message
>news:a3be01c3eb3d$4a5e43d0$(E-Mail Removed)...
>> Ok, thanks for the syntax information. Now I am having
>> another problem, I would like the code to check 2

things.
>> The first part of the code (where [CallStatus]="closed")
>> works great, but I would also like it to check if the
>> Closedby field is NOT null and the [CallStatus] field is
>> not equal to "Closed" then bring up an error message. I
>> am getting a compile error on the ElseIf. I assume I am
>> not writing this correctly. (Can you tell my VBA
>> knowledge is lacking??!!)
>>
>> If [CallStatus] = "Closed" And IsNull([Closedby]) Then
>> MsgBox "You must enter the Closed By information.",
>> vbOKOnly
>> [Closedby].SetFocus
>> Cancel = True
>>
>> ElseIf [CallStatus] <> "Closed" And IsNotNull
>> ([Closedby]) Then
>> MsgBox "You must change the Call Status to
>> Closed.", vbOKOnly
>> [CallStatus].SetFocus
>> Cancel = True
>> End If
>>
>> End If
>>
>>
>> Thank you,
>> Grace
>> >-----Original Message-----
>> >
>> >>-----Original Message-----
>> >>In the code below, I would like the msg box to appear

if
>> >>the [CallStatus] field is not equal to "Closed". I

just
>> >>don't know the syntax for "not equal to"!
>> >>
>> >>If [CallStatus] not equal to "Closed" And IsNotNull
>> >>([Closedby]) Then
>> >> MsgBox "You must change the Call Status to

Closed.",
>> >>vbOKOnly
>> >> [CallStatus].SetFocus
>> >> Cancel = True
>> >>End If
>> >>
>> >>Thanks for your help
>> >>.
>> >>I would use "<>".
>> >.
>> >

>
>
>.
>

 
Reply With Quote
 
Cheryl Fischer
Guest
Posts: n/a
 
      4th Feb 2004
You're welcome.

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


"Grace" <(E-Mail Removed)> wrote in message
news:9b4401c3eb5c$b3294210$(E-Mail Removed)...
> That worked GREAT!! Thanks so much.
>
> Grace
> >-----Original Message-----
> >Hello Grace,
> >
> >I believe the problem in the following line:
> >
> > ElseIf [CallStatus] <> "Closed" And IsNotNull

> ([Closedby]) Then
> >
> >is that there is not a function named IsNotNull().
> >
> >How about trying the following:
> >
> > ElseIf [CallStatus] <> "Closed" and Not IsNull

> ([Closedby]) then
> >
> >
> >hth and let us know...
> >--
> >
> >Cheryl Fischer, MVP Microsoft Access
> >Law/Sys Associates, Houston, TX
> >
> >
> >"Grace" <(E-Mail Removed)> wrote in

> message
> >news:a3be01c3eb3d$4a5e43d0$(E-Mail Removed)...
> >> Ok, thanks for the syntax information. Now I am having
> >> another problem, I would like the code to check 2

> things.
> >> The first part of the code (where [CallStatus]="closed")
> >> works great, but I would also like it to check if the
> >> Closedby field is NOT null and the [CallStatus] field is
> >> not equal to "Closed" then bring up an error message. I
> >> am getting a compile error on the ElseIf. I assume I am
> >> not writing this correctly. (Can you tell my VBA
> >> knowledge is lacking??!!)
> >>
> >> If [CallStatus] = "Closed" And IsNull([Closedby]) Then
> >> MsgBox "You must enter the Closed By information.",
> >> vbOKOnly
> >> [Closedby].SetFocus
> >> Cancel = True
> >>
> >> ElseIf [CallStatus] <> "Closed" And IsNotNull
> >> ([Closedby]) Then
> >> MsgBox "You must change the Call Status to
> >> Closed.", vbOKOnly
> >> [CallStatus].SetFocus
> >> Cancel = True
> >> End If
> >>
> >> End If
> >>
> >>
> >> Thank you,
> >> Grace
> >> >-----Original Message-----
> >> >
> >> >>-----Original Message-----
> >> >>In the code below, I would like the msg box to appear

> if
> >> >>the [CallStatus] field is not equal to "Closed". I

> just
> >> >>don't know the syntax for "not equal to"!
> >> >>
> >> >>If [CallStatus] not equal to "Closed" And IsNotNull
> >> >>([Closedby]) Then
> >> >> MsgBox "You must change the Call Status to

> Closed.",
> >> >>vbOKOnly
> >> >> [CallStatus].SetFocus
> >> >> Cancel = True
> >> >>End If
> >> >>
> >> >>Thanks for your help
> >> >>.
> >> >>I would use "<>".
> >> >.
> >> >

> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query from a Combo box for both equal to and not equal to. =?Utf-8?B?VG9tSw==?= Microsoft Access Queries 5 28th Mar 2007 03:36 PM
Why? 'Not equal' brings back whats 'equal' =?Utf-8?B?R2luYQ==?= Microsoft Access 6 20th Jul 2006 06:46 PM
greater than or equal to and less than or equal to symbols won't s =?Utf-8?B?bGFyYWxlYQ==?= Microsoft Word Document Management 1 1st Jun 2005 08:31 PM
lower and upper case equal on spreadsheet but not equal in VB don Microsoft Excel Programming 2 13th Mar 2005 01:04 AM
can I make cell "yes" equal 1, "no" equal 0 =?Utf-8?B?Y2FuIEkgbWFrZSBjZWxsICJ5ZXMiIGVxdWFsIDEs Microsoft Excel Misc 3 25th Jan 2005 09:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:21 AM.