Display a message

G

Guest

I have a main form. when a user clicks on a button to bring up a tabbed form
I want a message to display if a field on the 4th tab of the tabbed from is
empty. I am having a problem with the syntax.

this is what i have
Private Sub cmdPhysicianRateInfo_Click()

DoCmd.OpenForm "frmDevEnter/edit", acNormal
DoCmd.Maximize
If IsNull([comment] = False) Then
MsgBox ("you have mail")
End If
DoCmd.Close acForm, "frmMain"

End Sub

I get an error message which states

run time error 2465 can't find field name 'l' referred to in your
expression.

Any help would greatly be appreciated.

Thanks and have a nice day.
 
D

Douglas J. Steele

If IsNull([comment] = False) Then

is definitely incorrect, but I'm not sure whether that's the cause of the
error message.

Try:

If IsNull(Forms![frmDevEnter/edit]![comment]) = False Then
 
G

Guest

Thanks Mr. Steele that worked fine I think I got confused with the placement
of the parens

thanks again.

Douglas J. Steele said:
If IsNull([comment] = False) Then

is definitely incorrect, but I'm not sure whether that's the cause of the
error message.

Try:

If IsNull(Forms![frmDevEnter/edit]![comment]) = False Then


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Mykas_Robi said:
I have a main form. when a user clicks on a button to bring up a tabbed
form
I want a message to display if a field on the 4th tab of the tabbed from
is
empty. I am having a problem with the syntax.

this is what i have
Private Sub cmdPhysicianRateInfo_Click()

DoCmd.OpenForm "frmDevEnter/edit", acNormal
DoCmd.Maximize
If IsNull([comment] = False) Then
MsgBox ("you have mail")
End If
DoCmd.Close acForm, "frmMain"

End Sub

I get an error message which states

run time error 2465 can't find field name 'l' referred to in your
expression.

Any help would greatly be appreciated.

Thanks and have a nice day.
 
F

fredg

I have a main form. when a user clicks on a button to bring up a tabbed form
I want a message to display if a field on the 4th tab of the tabbed from is
empty. I am having a problem with the syntax.

this is what i have
Private Sub cmdPhysicianRateInfo_Click()

DoCmd.OpenForm "frmDevEnter/edit", acNormal
DoCmd.Maximize
If IsNull([comment] = False) Then
MsgBox ("you have mail")
End If
DoCmd.Close acForm, "frmMain"

End Sub

I get an error message which states

run time error 2465 can't find field name 'l' referred to in your
expression.

Any help would greatly be appreciated.

Thanks and have a nice day.

How about...

If Not IsNull(Forms![frmDevEnter/edit]![Comment]) Then

Note: It's not a good idea to include a / in the form's name.
/ is a divide by symbol. At some point, Access is sure to get
confused. I wouldn't use any symbol in an object's name.
 

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