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 / April 2005

Tip: Looking for answers? Try searching our database.

validation rule

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GraemeB - 11 Apr 2005 06:34 GMT
hi
does anyone know how to set a validation rule based on the answer to a combo
box...

eg - customer provides a phone number in one answer then is asked "do you
want an SMS notification" - a yes is only valid if there is a mobile number
on the previous field
Brendan Reynolds - 11 Apr 2005 09:36 GMT
A validation rule would look something like ...

[Notification]=False Or [MobileNumber] Is Not Null

However, there's not much point in using a validation rule like this in a
form. If I was going to use the validation rule, I'd do it in the table. In
the form, I'd disable the notification check box, and enable it in the
current event procedure of the form and the after update event procedure of
the mobile number text box, only if the mobile number text box contained a
value ...

Me!chkNotification.Enabled = (Len(Me!txtMobileNumber & vbNullString) > 0)

It's always better, if possible, to avoid offering an invalid choice rather
than to offer it and then throw an error. Think about how it looks to the
user ...

What's your mobile number?
I don't have one.
Do you want an SMS notification?
Yes please.
Well you can't have one, stupid, because you don't have a mobile number.

... as opposed to ...

What's your mobile number?
I don't have one.
OK. Unfortunately, I can't offer you the option of an SMS notification
without a mobile number, so let's move on ...

Which program would you rather use?

Signature

Brendan Reynolds (MVP)

> hi
> does anyone know how to set a validation rule based on the answer to a
[quoted text clipped - 5 lines]
> number
> on the previous field
 
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.