validation rule question

G

Guest

I know how to put in the proper validation rule for my text box in question,
but I sometimes need to change the info where the validation rule is in
place. Is there a way to override the rule without deleting it.

Example:
I enter in a date in a "Notice recieved" text box, automatically a date is
entered in a "follow up inspection" text box. But I can't manually change the
follow up inspection date without changing the notice recieved date.

Is there a way when I enter in a date that doesnt match the validation rule
to have a pop up that says "are you sure you want to put in a date that
doesn't match the validation rule"?
 
T

tina

But I can't manually change the
follow up inspection date without changing the notice recieved date.

*why* can't you change it? what is the validation rule you're referring to?
please post it. and *where* is the validation rule? in the table? in the
form? which field is it being applied to - the NoticeReceived field? or the
FollowupInspection field? and is the "follow up inspection" text box in your
form bound to a field in the underlying table? or is the ControlSource set
to "= something something"?
 
G

Guest

The validation rule is in the "follow up inspection" it reads =
DateAdd("d"[Notice Recieved],10), The "follow up inspection" is in a form. It
is not bound to anything that I know of. There is nothing in the control
source.

Thanks for the quick reply
 
R

Rick Brandt

Code said:
The validation rule is in the "follow up inspection" it reads =
DateAdd("d"[Notice Recieved],10), The "follow up inspection" is in a
form. It is not bound to anything that I know of. There is nothing in
the control source.

You cannot do what you want with a validation rules. They are absolute.
Either you can do something or you cannot. You can use code in the
BeforeUpdate event of the control instead of a validation rule to do what
you want.
 
T

tina

you'll have to get rid of the validation rule in the control's Properties
box. you *can* validate the data in the field when it's manually changed,
and trigger a "warning", using VBA. try adding something along the following
lines, to the "follow up inspection" textbox control's BeforeUpdate event
procedure, as

If Me![FollowupInspection] <> DateAdd("d"[Notice Recieved],10) Then
If MsgBox("Are you sure you want to enter a date other than the " _
& "default date?", vbYesNo) = vbNo Then
Cancel = True
End If
End If

hth


Code Agent said:
The validation rule is in the "follow up inspection" it reads =
DateAdd("d"[Notice Recieved],10), The "follow up inspection" is in a form. It
is not bound to anything that I know of. There is nothing in the control
source.

Thanks for the quick reply

tina said:
*why* can't you change it? what is the validation rule you're referring to?
please post it. and *where* is the validation rule? in the table? in the
form? which field is it being applied to - the NoticeReceived field? or the
FollowupInspection field? and is the "follow up inspection" text box in your
form bound to a field in the underlying table? or is the ControlSource set
to "= something something"?


change
the validation
rule
 
G

Guest

TINA!

Your a genious! It worked perfectly!!!!

Thanks a lot!

tina said:
you'll have to get rid of the validation rule in the control's Properties
box. you *can* validate the data in the field when it's manually changed,
and trigger a "warning", using VBA. try adding something along the following
lines, to the "follow up inspection" textbox control's BeforeUpdate event
procedure, as

If Me![FollowupInspection] <> DateAdd("d"[Notice Recieved],10) Then
If MsgBox("Are you sure you want to enter a date other than the " _
& "default date?", vbYesNo) = vbNo Then
Cancel = True
End If
End If

hth


Code Agent said:
The validation rule is in the "follow up inspection" it reads =
DateAdd("d"[Notice Recieved],10), The "follow up inspection" is in a form. It
is not bound to anything that I know of. There is nothing in the control
source.

Thanks for the quick reply

tina said:
But I can't manually change the
follow up inspection date without changing the notice recieved date.

*why* can't you change it? what is the validation rule you're referring to?
please post it. and *where* is the validation rule? in the table? in the
form? which field is it being applied to - the NoticeReceived field? or the
FollowupInspection field? and is the "follow up inspection" text box in your
form bound to a field in the underlying table? or is the ControlSource set
to "= something something"?


I know how to put in the proper validation rule for my text box in
question,
but I sometimes need to change the info where the validation rule is in
place. Is there a way to override the rule without deleting it.

Example:
I enter in a date in a "Notice recieved" text box, automatically a date is
entered in a "follow up inspection" text box. But I can't manually change
the
follow up inspection date without changing the notice recieved date.

Is there a way when I enter in a date that doesnt match the validation
rule
to have a pop up that says "are you sure you want to put in a date that
doesn't match the validation rule"?
 
T

tina

you're welcome :)


Code Agent said:
TINA!

Your a genious! It worked perfectly!!!!

Thanks a lot!

tina said:
you'll have to get rid of the validation rule in the control's Properties
box. you *can* validate the data in the field when it's manually changed,
and trigger a "warning", using VBA. try adding something along the following
lines, to the "follow up inspection" textbox control's BeforeUpdate event
procedure, as

If Me![FollowupInspection] <> DateAdd("d"[Notice Recieved],10) Then
If MsgBox("Are you sure you want to enter a date other than the " _
& "default date?", vbYesNo) = vbNo Then
Cancel = True
End If
End If

hth


Code Agent said:
The validation rule is in the "follow up inspection" it reads =
DateAdd("d"[Notice Recieved],10), The "follow up inspection" is in a
form.
It
is not bound to anything that I know of. There is nothing in the control
source.

Thanks for the quick reply

:

But I can't manually change the
follow up inspection date without changing the notice recieved date.

*why* can't you change it? what is the validation rule you're
referring
to?
please post it. and *where* is the validation rule? in the table? in the
form? which field is it being applied to - the NoticeReceived field?
or
the
FollowupInspection field? and is the "follow up inspection" text box
in
your
form bound to a field in the underlying table? or is the
ControlSource
set
to "= something something"?


I know how to put in the proper validation rule for my text box in
question,
but I sometimes need to change the info where the validation rule
is
in
place. Is there a way to override the rule without deleting it.

Example:
I enter in a date in a "Notice recieved" text box, automatically a date is
entered in a "follow up inspection" text box. But I can't manually change
the
follow up inspection date without changing the notice recieved date.

Is there a way when I enter in a date that doesnt match the validation
rule
to have a pop up that says "are you sure you want to put in a date that
doesn't match the validation rule"?
 

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

Similar Threads


Top