Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

text box validation rule trouble

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith G Hicks - 17 Mar 2005 19:24 GMT
I think I've just been staring at this too long. I have 3 text boxes on a
form for 3 credit report numbers. I can't allow them all to be blank. At
least one of them is required. So I'm putting the following into the
"ValidationRule" property of the control (TRW, TU and Eqf are all text boxes
bound to backend fields (jet) of the same name):

Not IsNull([TRW]) And Not IsNull([TU]) And Not IsNull([Eqf])

I've only put it in the TRW control for now just to test. When I have a
value in the TU controol and then delete the value from teh TRW control, my
ValidationText still fires. Clearly not all of them are null. It should
allow me to leave the TRW control after deleting its contents if there is a
value in the TU control.

If anyone can tell me what I'm doing wrong here I'd appreciate it.

Thanks,

Keith
Keith G Hicks - 17 Mar 2005 19:37 GMT
No big deal. I decided to handle it in the BeforeUpdate event of each
control. Much easier that way anyhow. But if anyone has any info on why my
other idea wouldn't work, let me know. :)

Keith
Marshall Barton - 17 Mar 2005 20:25 GMT
>No big deal. I decided to handle it in the BeforeUpdate event of each
>control. Much easier that way anyhow. But if anyone has any info on why my
>other idea wouldn't work, let me know. :)

Your logic was wrong, it need OR instead of AND, but I think
that's irrelevant because the validation rule only applies
to the control's bound field and doesn't process an entire
expression that includes a reference to other controls.

The Form's Before Update event is the right place for this
kind of check.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.