Validation Rule

G

Guest

I am trying to get the tab to stop if data is not entered into the text box. When I enter=(is not null) I get a data error. Please advise.
 
G

Gerald Stanley

Have you tried the IsNull(<variable>) function?

Hope That Helps
Gerlad Stanley MCSD
-----Original Message-----
I am trying to get the tab to stop if data is not entered
into the text box. When I enter=(is not null) I get a data
error. Please advise.
 
T

TC

If you want to ensure that the textbox has a value before each new or edited
record is saved, put the following statement in the BeforeUpdate event of
the *form* (not the textbox):

cancel = isnull (me![txtBlah])

where txtBlah is the name of your textbox.

HTH,
TC


Deanna said:
I am trying to get the tab to stop if data is not entered into the text
box. When I enter=(is not null) I get a data error. Please advise.
 
M

Michel Walsh

Hi,


Set the required property of the field, in the design table, to yes (Jet)
or uncheck Allow Null (in MS SQL Server). That will enforce the requirement
every where you use the table. If you want to enforce it only for one
particular form, follow the suggestion by TC here up (you can use the after
update event of the control too, and you can add an error message to warn
the end user that the absence of data is incorrect).




Hoping it may help,
Vanderghast, Access MVP

Deanna said:
I am trying to get the tab to stop if data is not entered into the text
box. When I enter=(is not null) I get a data error. Please advise.
 
T

TC

Yes - a far simpler method!

But, I don't like afterupdate of the control. This won't force the user to
put anything in that control. (It will only stop them erasing an existing,
saved or unsaved value.) That's why I sugested beforeupdate of the form.

Cheers,
TC
 

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