Can Access solve the following problem?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My manager at work gave me an example of a kind of problem and wants to know if Access can help deal with it
Here is the problem

On page 1 of a patient questionnaire, an individual fails to check a box that indicates that they are pregnant. However, on page 3, they are answering portions of the questionnaire that only those individuals who are pregnant should be responding to.

What my manager needs is for the database to recognize, and direct the users attention to, these kinds of problems. Can Access do this? And, if so, where do I begin to learn how to deal with these problems? I am a c# programmer. Can I resolve these kinds of issues programmatically, or are there easier solutions

Any help would be greatly appreciated

Thanks
 
What my manager needs is for the database to recognize, and direct the users attention to, these kinds of problems. Can Access do this? And, if so, where do I begin to learn how to deal with these problems? I am a c# programmer. Can I resolve these kinds of issues programmatically, or are there easier solutions?

There are a couple of ways to do this - "Table Validation Rules"
would, for example, cause an error message to be posted if the user
enters data into a pregnancy-related field if they checked no to
pregnancy (or, for that matter, if they are male!)

The messages can be confusing though; generally it would be better to
use VBA code in the Form in which they are entering data. Each control
on the Form has a BeforeUpdate event which can be canceled - one could
put code such as:

Private Sub txtDateOfConception_BeforeUpdate(Cancel as Integer)
If Me!Pregnant <> True Then
MsgBox "This field should only be filled out if you are pregnant."
Cancel = True
End If
End Sub

More sophisticated solutions are possible; for instance, one could
have the Enabled property of these controls all set to False so the
user would not be able to even click into the control. In the
AfterUpdate event of the Pregnant checkbox you could enable that set
of controls.
 
Back
Top