Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

validation rule question

Discussion in 'Information Technology' started by Code Agent, Nov 4, 2005.

  1. Code Agent

    Code Agent
    Expand Collapse
    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"?
     
  2. Loading...


  3. tina

    tina
    Expand Collapse
    Guest

    > 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"?


    "Code Agent" <CodeAgent@discussions.microsoft.com> wrote in message
    news:C2075F8A-E5A8-4AEB-BBC5-7021C60DAF8C@microsoft.com...
    > 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"?
     
  4. Code Agent

    Code Agent
    Expand Collapse
    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

    "tina" wrote:

    > > 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"?
    >
    >
    > "Code Agent" <CodeAgent@discussions.microsoft.com> wrote in message
    > news:C2075F8A-E5A8-4AEB-BBC5-7021C60DAF8C@microsoft.com...
    > > 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"?

    >
    >
    >
     
  5. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Code Agent wrote:
    > 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.

    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com
     
  6. tina

    tina
    Expand Collapse
    Guest

    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" <CodeAgent@discussions.microsoft.com> wrote in message
    news:BB9C5AC9-5580-4987-A1A6-2D692B9EA027@microsoft.com...
    > 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" wrote:
    >
    > > > 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"?
    > >
    > >
    > > "Code Agent" <CodeAgent@discussions.microsoft.com> wrote in message
    > > news:C2075F8A-E5A8-4AEB-BBC5-7021C60DAF8C@microsoft.com...
    > > > 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"?

    > >
    > >
    > >
     
  7. Code Agent

    Code Agent
    Expand Collapse
    Guest

    TINA!

    Your a genious! It worked perfectly!!!!

    Thanks a lot!

    "tina" wrote:

    > 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" <CodeAgent@discussions.microsoft.com> wrote in message
    > news:BB9C5AC9-5580-4987-A1A6-2D692B9EA027@microsoft.com...
    > > 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" wrote:
    > >
    > > > > 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"?
    > > >
    > > >
    > > > "Code Agent" <CodeAgent@discussions.microsoft.com> wrote in message
    > > > news:C2075F8A-E5A8-4AEB-BBC5-7021C60DAF8C@microsoft.com...
    > > > > 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"?
    > > >
    > > >
    > > >

    >
    >
    >
     
  8. tina

    tina
    Expand Collapse
    Guest

    you're welcome :)


    "Code Agent" <CodeAgent@discussions.microsoft.com> wrote in message
    news:5848127E-4630-451A-A745-7A40ED952E92@microsoft.com...
    > TINA!
    >
    > Your a genious! It worked perfectly!!!!
    >
    > Thanks a lot!
    >
    > "tina" wrote:
    >
    > > 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" <CodeAgent@discussions.microsoft.com> wrote in message
    > > news:BB9C5AC9-5580-4987-A1A6-2D692B9EA027@microsoft.com...
    > > > 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" wrote:
    > > >
    > > > > > 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"?
    > > > >
    > > > >
    > > > > "Code Agent" <CodeAgent@discussions.microsoft.com> wrote in message
    > > > > news:C2075F8A-E5A8-4AEB-BBC5-7021C60DAF8C@microsoft.com...
    > > > > > 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"?
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >
     

Share This Page