Validating data entry

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

Guest

I am trying to identify illogical data entries on the data entry form.
The questions are:
1. Is Form A required? (Y or N)
1.a If yes, was it submitted? (Y, N or N/A)
1.b If yes, was it signed by the approprate person (Y, N or N/A)

so if #1. is N, #1.a & #1.b can be N/A, if #1 is Y, #1.a can be Y or N, if
#1 & #1.a are Y, #1.b can be Y or N.

I was handling these by identifying the illogical satements in my reports
and simply removing them from the matrix. I have been told that this is not
good enough anymore.

I have tried IIF statements but can not make them work, can anyone offer
some suggestions?
 
I am trying to identify illogical data entries on the data entry form.
The questions are:
1. Is Form A required? (Y or N)
1.a If yes, was it submitted? (Y, N or N/A)
1.b If yes, was it signed by the approprate person (Y, N or N/A)

so if #1. is N, #1.a & #1.b can be N/A, if #1 is Y, #1.a can be Y or N, if
#1 & #1.a are Y, #1.b can be Y or N.

I was handling these by identifying the illogical satements in my reports
and simply removing them from the matrix. I have been told that this is not
good enough anymore.

I have tried IIF statements but can not make them work, can anyone offer
some suggestions?

I'd suggest using the Form's BeforeUpdate event to validate the data entry.
You can use code like

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Me.FormARequired="Y" Then
If Me.FormSubmitted = "N/A" Then
MsgBox "Choose Y or N for FormSubmitted", vbOKOnly
Cancel = True
End If
Else
If Me.FormSubmitted = "Y" Or Me.FormSubmitted = "N" Then
MsgBox "Don't be silly, you don't need to submit Form A!", vbOKOnly
Me.FormSubmitted = "N/A"
End If
End If
.... <etc>

Or you can actually set the values or even the Visible property of controls
1.a and 1.b in the AfterUpdate event of 1.

John W. Vinson [MVP]
 
This is an illistration of using iif:

=iif( #1="Yes", iif( #1.a="Yes" , iif( #1.b="Yes", "Completed", "Form Not
Signed Yet"), "Form Not Submitted"), "N/A")

Obviously changes will be required to fit correctly into your project.
 

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

Back
Top