null value in an input masked field

G

Guest

I have a form with a field named [SSN], it has an input mask with "_" as
placeholders. The form has a command button [Next Record] to go to a new
record, it has coding to check for empty fields and warn the user about them.

The coding associated with the SSN is:
If [SSN]="" then
msgbox "The SSN box is empty",48,"Empty field!"
end if

The coding is never executed even if there is no SSN typed. Is this because
of the mask?
Thank you for your help.
 
G

Guest

Opps! That was a Typo, sorry.
S4oemtim@s mY tpyong iz nutso good= :)

Ricoy-Chicago said:
Sorry...
It worked. However on the coding section: If IsNull(Me![SSN]=) the equal
sign is not needed.

Thankx.

Klatuu said:
The subject line and content of your post are contridictory. "" And Null are
two different things. Have you traced the code in Debug to see whether it is
executing or are you basing this on not having seen the message when you
expect? I suspect the latter.

Try it this way:
If IsNull(Me![SSN]=) Or Me![SSN]="" then
msgbox "The SSN box is empty",48,"Empty field!"
end if


Ricoy-Chicago said:
I have a form with a field named [SSN], it has an input mask with "_" as
placeholders. The form has a command button [Next Record] to go to a new
record, it has coding to check for empty fields and warn the user about them.

The coding associated with the SSN is:
If [SSN]="" then
msgbox "The SSN box is empty",48,"Empty field!"
end if

The coding is never executed even if there is no SSN typed. Is this because
of the mask?
Thank you for your help.
 
J

John Vinson

I have a form with a field named [SSN], it has an input mask with "_" as
placeholders. The form has a command button [Next Record] to go to a new
record, it has coding to check for empty fields and warn the user about them.

The coding associated with the SSN is:
If [SSN]="" then
msgbox "The SSN box is empty",48,"Empty field!"
end if

The coding is never executed even if there is no SSN typed. Is this because
of the mask?
Thank you for your help.

Nope; it's because the textbox is NULL, rather than containing an
empty string. Change the IF to

If IsNull([SSN]) Then


John W. Vinson[MVP]
 
G

Guest

Sorry...
It worked. However on the coding section: If IsNull(Me![SSN]=) the equal
sign is not needed.

Thankx.

Klatuu said:
The subject line and content of your post are contridictory. "" And Null are
two different things. Have you traced the code in Debug to see whether it is
executing or are you basing this on not having seen the message when you
expect? I suspect the latter.

Try it this way:
If IsNull(Me![SSN]=) Or Me![SSN]="" then
msgbox "The SSN box is empty",48,"Empty field!"
end if


Ricoy-Chicago said:
I have a form with a field named [SSN], it has an input mask with "_" as
placeholders. The form has a command button [Next Record] to go to a new
record, it has coding to check for empty fields and warn the user about them.

The coding associated with the SSN is:
If [SSN]="" then
msgbox "The SSN box is empty",48,"Empty field!"
end if

The coding is never executed even if there is no SSN typed. Is this because
of the mask?
Thank you for your help.
 

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