Runtime error 424-Event Expression

V

VickiS

I have a form with a field [PassFail] where the required entry is either
Null, the word PASS or the word FAIL. I want to code an After Update Event
for a MsgBox if the entry in the field is not Null, PASS or FAIL. I've tried
various methods to no avail. Here's my last attempt -- I'm getting a Runtime
error 424: Object Required error:

If Me.PassFail Is Not Null And Not Me.PassFail = "Pass" And Not Me.PassFail
= "Fail" Then
MsgBox ("Please input 'Pass' or 'Fail' only"), vbCritical, , , vbOK
End If

Please tell me what I need to code to get the message box to display. I'm
using Access 2002. Thanks!
 
G

Graham R Seach

Vikki,

If Len(Nz(Me!PassFail, "")) > 0 And Nz(Me!PassFail, "") <> "Pass" And
Nz(Me!PassFail, "") <> "Fail" Then

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
V

VickiS

That got me past the first line ... now I'm getting a Runtime Error '5'
(Invalid Procedure Call or Argument) on:

MsgBox "Please input 'Pass' or 'Fail' only", vbCritical, , , vbOK

More Help ... please !?!?!? Thanks for your speedy response!

Vicki

Graham R Seach said:
Vikki,

If Len(Nz(Me!PassFail, "")) > 0 And Nz(Me!PassFail, "") <> "Pass" And
Nz(Me!PassFail, "") <> "Fail" Then

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

VickiS said:
I have a form with a field [PassFail] where the required entry is either
Null, the word PASS or the word FAIL. I want to code an After Update Event
for a MsgBox if the entry in the field is not Null, PASS or FAIL. I've
tried
various methods to no avail. Here's my last attempt -- I'm getting a
Runtime
error 424: Object Required error:

If Me.PassFail Is Not Null And Not Me.PassFail = "Pass" And Not
Me.PassFail
= "Fail" Then
MsgBox ("Please input 'Pass' or 'Fail' only"), vbCritical, , , vbOK
End If

Please tell me what I need to code to get the message box to display. I'm
using Access 2002. Thanks!
 
G

Graham R Seach

Viki,

I don't know how you came to arrive at that syntax for MsgBox, but here's
what you should be using:
MsgBox "Please input 'Pass' or 'Fail' only", vbCritical + vbOKOnly

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

VickiS said:
That got me past the first line ... now I'm getting a Runtime Error '5'
(Invalid Procedure Call or Argument) on:

MsgBox "Please input 'Pass' or 'Fail' only", vbCritical, , , vbOK

More Help ... please !?!?!? Thanks for your speedy response!

Vicki

Graham R Seach said:
Vikki,

If Len(Nz(Me!PassFail, "")) > 0 And Nz(Me!PassFail, "") <> "Pass" And
Nz(Me!PassFail, "") <> "Fail" Then

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

VickiS said:
I have a form with a field [PassFail] where the required entry is either
Null, the word PASS or the word FAIL. I want to code an After Update
Event
for a MsgBox if the entry in the field is not Null, PASS or FAIL. I've
tried
various methods to no avail. Here's my last attempt -- I'm getting a
Runtime
error 424: Object Required error:

If Me.PassFail Is Not Null And Not Me.PassFail = "Pass" And Not
Me.PassFail
= "Fail" Then
MsgBox ("Please input 'Pass' or 'Fail' only"), vbCritical, , , vbOK
End If

Please tell me what I need to code to get the message box to display.
I'm
using Access 2002. Thanks!
 

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