I want to make a Controls Events Fire using code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg (codepug@gmail.com)

    I want to make a Controls Events Fire using code

    For lack of the proper expression, how do I excite a control to cause
    events to trigger.
    I have a date control and am using a calender form button to fill the
    text box with the date.
    The text box is bound to a field. All this works great, but now the
    date range validation is not
    not working and the after update event that did calculations is not
    working. This is without question the result of the control not
    firing because I'm using code to make the entry. There must be a way
    to make the control Dirty or whatever so that the events for the
    control fire.

    Any ideas?
  • paii, Ron

    #2
    Re: I want to make a Controls Events Fire using code


    <codepug@gmail. comwrote in message
    news:a400a6fb-ccbf-46b6-927a-805c6222610d@p2 5g2000hsf.googl egroups.com...
    For lack of the proper expression, how do I excite a control to cause
    events to trigger.
    I have a date control and am using a calender form button to fill the
    text box with the date.
    The text box is bound to a field. All this works great, but now the
    date range validation is not
    not working and the after update event that did calculations is not
    working. This is without question the result of the control not
    firing because I'm using code to make the entry. There must be a way
    to make the control Dirty or whatever so that the events for the
    control fire.
    >
    Any ideas?
    Validate the date before filling in the field?

    Otherwise the event function is a sub routine that can be called.


    Comment

    • Bob Quintal

      #3
      Re: I want to make a Controls Events Fire using code

      "Greg (codepug@gmail. com)" <codepug@gmail. comwrote in
      news:a400a6fb-ccbf-46b6-927a-
      805c6222610d@p2 5g2000hsf.googl egroups.co
      m:
      For lack of the proper expression, how do I excite a control to
      cause events to trigger.
      I have a date control and am using a calender form button to fill
      the text box with the date.
      The text box is bound to a field. All this works great, but now
      the date range validation is not
      not working and the after update event that did calculations is
      not working. This is without question the result of the control
      not firing because I'm using code to make the entry. There must be
      a way to make the control Dirty or whatever so that the events for
      the control fire.
      >
      Any ideas?
      What you need to do is call the event procedure associated with the
      event. Check out the Call statement in Help.

      --
      Bob Quintal

      PA is y I've altered my email address.
      ** Posted from http://www.teranews.com **

      Comment

      • Greg (codepug@gmail.com)

        #4
        Re: I want to make a Controls Events Fire using code

        Thanks Bob

        But I don't think you call the Validation Event using code?
        I guess it requires a workaround.

        Greg


        On Aug 11, 5:40 pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
        "Greg (code...@gmail. com)" <code...@gmail. comwrote in
        news:a400a6fb-ccbf-46b6-927a-
        805c62226...@p2 5g2000hsf.googl egroups.co
        m:
        >
        For lack of the proper expression, how do I excite a control to
        cause events to trigger.
        I have a date control and am using a calender form button to fill
        the text box with the date.
        The text box is bound to a field. All this works great, but now
        the date range validation is not
        not working and the after update event that did calculations is
        not working.  This is without question the result of the control
        not firing because I'm using code to make the entry. There must be
        a way to make the control Dirty or whatever so that the events for
        the control fire.
        >
        Any ideas?
        >
        What you need to do is call the event procedure associated with the
        event. Check out the Call statement in Help.
        >
        --
        Bob Quintal
        >
        PA is y I've altered my email address.
        ** Posted fromhttp://www.teranews.co m**

        Comment

        • Bob Quintal

          #5
          Re: I want to make a Controls Events Fire using code

          "Greg (codepug@gmail. com)" <codepug@gmail. comwrote in news:ba9dc9ea-
          becf-4464-b7d4-726bec019715@k7 g200...le groups.com:
          Thanks Bob
          >
          But I don't think you call the Validation Event using code?
          I guess it requires a workaround.
          >
          Greg
          I have no idea about what you mean in the phrase "Validation Event".
          It's not an event associated with any Control, Form, Report or Query
          that I've ever seen or heard of before.

          The closest I can think of is the "Validation Rule" in the table
          design, and that's not controllable via code.

          If you mean "Validation Code", that can go into many events, depending
          on WHAT is being validated. The control before and/or after_update
          events and the Form's Before_Update are the usual places for this.

          Please provide an explanation of WHAT you want to do, so we can tell
          you the correct way to perform what you want to do. \That's what we're
          here for.
          >
          >
          On Aug 11, 5:40 pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
          >"Greg (code...@gmail. com)" <code...@gmail. comwrote in
          >news:a400a6f b-ccbf-46b6-927a-
          >805c62226...@p 25g2000hsf.goog legroups.co
          >m:
          >>
          For lack of the proper expression, how do I excite a control to
          cause events to trigger.
          I have a date control and am using a calender form button to fill
          the text box with the date.
          The text box is bound to a field. All this works great, but now
          the date range validation is not
          not working and the after update event that did calculations is
          not working.  This is without question the result of the control
          not firing because I'm using code to make the entry. There must be
          a way to make the control Dirty or whatever so that the events for
          the control fire.
          >>
          Any ideas?
          >>
          >What you need to do is call the event procedure associated with the
          >event. Check out the Call statement in Help.
          >>
          >--
          >Bob Quintal
          >>
          >PA is y I've altered my email address.
          >** Posted fromhttp://www.teranews.co m**
          >
          >


          --
          Bob Quintal

          PA is y I've altered my email address.
          ** Posted from http://www.teranews.com **

          Comment

          • Greg (codepug@gmail.com)

            #6
            Re: I want to make a Controls Events Fire using code

            Thanks Bob

            My mistake. I didn't realize that the ValidationRule was not a
            traditional event.
            I'll have to experiment with code in the beforeupdate event to make
            sure that the START date entered by my calender form button is <=
            2000, and not greater that
            the END date. And need to also excite the textbox using code, because
            that does not take place now, and the entry goes unnoticed.



            On Aug 12, 5:35 pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
            "Greg (code...@gmail. com)" <code...@gmail. comwrote in news:ba9dc9ea-
            becf-4464-b7d4-726bec019...@k7 g2000hsd.google groups.com:
            >
            Thanks Bob
            >
            But I don't think you call the Validation Event using code?
            I guess it requires a workaround.
            >
            Greg
            >
            I have no idea about what you mean in the phrase "Validation Event".
            It's not an event associated with any Control, Form, Report or Query
            that I've ever seen or heard of before.
            >
            The closest I can think of is the "Validation Rule" in the table
            design, and that's not controllable via code.
            >
            If you mean "Validation Code", that can go into many events, depending
            on WHAT is being validated. The control before and/or after_update
            events and the Form's Before_Update are the usual places for this.
            >
            Please provide an explanation of WHAT you want to do, so we can tell
            you the correct way to perform what you want to do. \That's what we're
            here for.
            >
            >
            >
            >
            >
            >
            >
            On Aug 11, 5:40 pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
            "Greg (code...@gmail. com)" <code...@gmail. comwrote in
            news:a400a6fb-ccbf-46b6-927a-
            805c62226...@p2 5g2000hsf.googl egroups.co
            m:
            >
            For lack of the proper expression, how do I excite a control to
            cause events to trigger.
            I have a date control and am using a calender form button to fill
            the text box with the date.
            The text box is bound to a field. All this works great, but now
            the date range validation is not
            not working and the after update event that did calculations is
            not working.  This is without question the result of the control
            not firing because I'm using code to make the entry. There must be
            a way to make the control Dirty or whatever so that the events for
            the control fire.
            >
            Any ideas?
            >
            What you need to do is call the event procedure associated with the
            event. Check out the Call statement in Help.
            >
            --
            Bob Quintal
            >
            PA is y I've altered my email address.
            ** Posted fromhttp://www.teranews.co m**
            >
            --
            Bob Quintal
            >
            PA is y I've altered my email address.
            ** Posted fromhttp://www.teranews.co m**- Hide quoted text -
            >
            - Show quoted text -

            Comment

            • Bob Quintal

              #7
              Re: I want to make a Controls Events Fire using code

              "Greg (codepug@gmail. com)" <codepug@gmail. comwrote in
              news:b551597d-dcf8-4b93-a9b7-bce441eb5c3a@a7 0g2000hsh.googl egroups.co
              m:
              Thanks Bob
              >
              My mistake. I didn't realize that the ValidationRule was not a
              traditional event.
              The only thing that triggers the validation rule is writing the record
              back to the table. That may be adequate, although it's often too late
              in the data entry process to be user friendly..
              --
              Bob Quintal

              PA is y I've altered my email address.
              ** Posted from http://www.teranews.com **

              Comment

              • Bob Quintal

                #8
                Re: I want to make a Controls Events Fire using code

                "Greg (codepug@gmail. com)" <codepug@gmail. comwrote in
                news:b551597d-dcf8-4b93-a9b7-
                bce441eb5c3a@a7 0g2000hsh.googl egroups.co
                m:
                Thanks Bob
                >
                My mistake. I didn't realize that the ValidationRule was not a
                traditional event.
                I'll have to experiment with code in the beforeupdate event to
                make sure that the START date entered by my calender form button
                is <2000, and not greater that the END date. And need to also
                excite the textbox using code, because that does not take place
                now, and the entry goes unnoticed.
                >
                Put the code into the before update event.
                In the code behind the calendar form's button,
                call Forms!<<mainfor m>>!<<textbox>> _AfterUpdate.

                You need to change that event's definition to public.
                and the <<mainform>>, <<textbox>metav ariables to the real names.


                Q
                >
                >
                On Aug 12, 5:35 pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
                >"Greg (code...@gmail. com)" <code...@gmail. comwrote in
                >news:ba9dc9e a-
                >becf-4464-b7d4-726bec019...@k7 g2000hsd.google groups.com:
                >>
                Thanks Bob
                >>
                But I don't think you call the Validation Event using code?
                I guess it requires a workaround.
                >>
                Greg
                >>
                >I have no idea about what you mean in the phrase "Validation
                >Event". It's not an event associated with any Control, Form,
                >Report or Query that I've ever seen or heard of before.
                >>
                >The closest I can think of is the "Validation Rule" in the table
                >design, and that's not controllable via code.
                >>
                >If you mean "Validation Code", that can go into many events,
                >depending on WHAT is being validated. The control before and/or
                >after_update events and the Form's Before_Update are the usual
                >places for this.
                >>
                >Please provide an explanation of WHAT you want to do, so we can
                >tell you the correct way to perform what you want to do. \That's
                >what we're here for.
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                On Aug 11, 5:40 pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
                >"Greg (code...@gmail. com)" <code...@gmail. comwrote in
                >news:a400a6f b-ccbf-46b6-927a-
                >805c62226...@p 25g2000hsf.goog legroups.co
                >m:
                >>
                For lack of the proper expression, how do I excite a control
                to cause events to trigger.
                I have a date control and am using a calender form button to
                fill the text box with the date.
                The text box is bound to a field. All this works great, but
                now the date range validation is not
                not working and the after update event that did calculations
                is not working.  This is without question the result of the
                control not firing because I'm using code to make the entry.
                There must be a way to make the control Dirty or whatever so
                that the events for the control fire.
                >>
                Any ideas?
                >>
                >What you need to do is call the event procedure associated
                >with the event. Check out the Call statement in Help.
                >>
                >--
                >Bob Quintal
                >>
                >PA is y I've altered my email address.
                >** Posted fromhttp://www.teranews.co m**
                >>
                >--
                >Bob Quintal
                >>
                >PA is y I've altered my email address.
                >** Posted fromhttp://www.teranews.co m**- Hide quoted text -
                >>
                >- Show quoted text -
                >
                >


                --
                Bob Quintal

                PA is y I've altered my email address.
                ** Posted from http://www.teranews.com **

                Comment

                • Larry Linson

                  #9
                  Re: I want to make a Controls Events Fire using code

                  <codepug@gmail. comwrote
                  My mistake. I didn't realize that the ValidationRule
                  was not a traditional event.
                  An Access Validation Rule is a Property, not an event. You can write
                  validation for the BeforeUpdate event of a Form, or the AfterUpdate event of
                  many Controls, if you want to performs some complex validation.
                  I'll have to experiment with code in the
                  beforeupdate event to make sure that the
                  START date entered by my calender form
                  button is <= 2000, and not greater that
                  the END date.
                  You press, or click, a Button Control, and you execute code or macros, but
                  values are going to come from some other source.
                  And need to also excite the textbox
                  using code, because that does not
                  take place now, and the entry goes
                  unnoticed.
                  "Excite" a text box? Do you perhaps mean "highlight" the textbox, for
                  example, by changing the backcolor or the text color? If you'll clarify, I
                  am sure someone can assist.

                  Larry Linson
                  Microsoft Office Access MVP


                  Comment

                  Working...