Validation Rule

A

aubrey

Hello,

i have two fields "Assessment Type" and "Assessment Due Date"

the "Assessment Type" field is a dropdown field, which has an option of
"Internal Audit"

i want a validation rule that says if "Internal Audit" is selected in the
"Assessment Type" field no information should be able to be entered in the
"Assessment Due Date" field.

any help with the validation rule or any other way to accomplish this would
be great

Thank you,
 
J

Jeff Boyce

Aubrey

One approach might be to add a bit of code to an event procedure triggered
by the AfterUpdate event of your [AssessmentType] control. I am assuming,
since you posted in a "forms" newsgroup, that you are trying to do this in a
FORM, not directly in a table.

Your AfterUpdate code could look like (untested):

If Me!cboAssessmentType.Column(1) = "Internal Audit" Then
Me!txtAssessmentDueDate.Enabled = True
Else
'what do you want to have happen if it isn't "internal audit"?
End If

Note that the .Column(n) reference is zero-based (starts counting at 0, not
1), and should 'point' to the column in which the text of the Assessment
Type is returned by the query that feeds your combobox (drop-down).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

aubrey

Hi jeff,

thanks for the response.

i don't want anything specific to be done if the "Assesment Type" is not
"Internal Audit"

i just the "Assesment Due Date" to be blank out, or no information to be
entered, if "Internal Audit" is selected.

Thanks again,



Jeff Boyce said:
Aubrey

One approach might be to add a bit of code to an event procedure triggered
by the AfterUpdate event of your [AssessmentType] control. I am assuming,
since you posted in a "forms" newsgroup, that you are trying to do this in a
FORM, not directly in a table.

Your AfterUpdate code could look like (untested):

If Me!cboAssessmentType.Column(1) = "Internal Audit" Then
Me!txtAssessmentDueDate.Enabled = True
Else
'what do you want to have happen if it isn't "internal audit"?
End If

Note that the .Column(n) reference is zero-based (starts counting at 0, not
1), and should 'point' to the column in which the text of the Assessment
Type is returned by the query that feeds your combobox (drop-down).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP



aubrey said:
Hello,

i have two fields "Assessment Type" and "Assessment Due Date"

the "Assessment Type" field is a dropdown field, which has an option of
"Internal Audit"

i want a validation rule that says if "Internal Audit" is selected in the
"Assessment Type" field no information should be able to be entered in the
"Assessment Due Date" field.

any help with the validation rule or any other way to accomplish this
would
be great

Thank you,
 
J

Jeff Boyce

Aubrey

Can you use the general approach I offered to do the specific task?

Regards

Jeff Boyce
Microsoft Office/Access MVP


aubrey said:
Hi jeff,

thanks for the response.

i don't want anything specific to be done if the "Assesment Type" is not
"Internal Audit"

i just the "Assesment Due Date" to be blank out, or no information to be
entered, if "Internal Audit" is selected.

Thanks again,



Jeff Boyce said:
Aubrey

One approach might be to add a bit of code to an event procedure
triggered
by the AfterUpdate event of your [AssessmentType] control. I am
assuming,
since you posted in a "forms" newsgroup, that you are trying to do this
in a
FORM, not directly in a table.

Your AfterUpdate code could look like (untested):

If Me!cboAssessmentType.Column(1) = "Internal Audit" Then
Me!txtAssessmentDueDate.Enabled = True
Else
'what do you want to have happen if it isn't "internal audit"?
End If

Note that the .Column(n) reference is zero-based (starts counting at 0,
not
1), and should 'point' to the column in which the text of the Assessment
Type is returned by the query that feeds your combobox (drop-down).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP



aubrey said:
Hello,

i have two fields "Assessment Type" and "Assessment Due Date"

the "Assessment Type" field is a dropdown field, which has an option of
"Internal Audit"

i want a validation rule that says if "Internal Audit" is selected in
the
"Assessment Type" field no information should be able to be entered in
the
"Assessment Due Date" field.

any help with the validation rule or any other way to accomplish this
would
be great

Thank you,
 

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

Top