Validation Rule

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
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.
 
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.
 
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
 
Back
Top