Where Am I?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ApexData@gmail.com

    #1

    Where Am I?

    If I am in a combobox, is there are way of determining which control
    was clicked outside the combobox, before I actually leave the combobox?
    I would like to make a decision at the combobox control about what
    control
    was clicked outside that box.

    ThankYou

  • fredg

    #2
    Re: Where Am I?

    On 9 Apr 2006 09:18:08 -0700, ApexData@gmail. com wrote:
    [color=blue]
    > If I am in a combobox, is there are way of determining which control
    > was clicked outside the combobox, before I actually leave the combobox?
    > I would like to make a decision at the combobox control about what
    > control
    > was clicked outside that box.
    >
    > ThankYou[/color]

    Code a suitable ComboBox event:

    If Screen.Previous Control.Name = "SpecificContro lName" then
    etc........
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail

    Comment

    • ApexData@gmail.com

      #3
      Re: Where Am I?

      Thankyou for your response Fred.
      I'm not sure? But I believe your suggestion
      implies that I have to leave the combobox to
      get my answer, and this is what I do not want
      to do. Am I correct?

      Comment

      • tina

        #4
        Re: Where Am I?

        is this a continuation of your question in last night's post titled "Require
        Combobox Entry"? if so, i think salad's code, with a small revision, will
        accomplish your goal of preventing the user from entering data in other
        controls until a value is entered in the combo box control - while allowing
        the user to exit the form entirely, without entering a value in *any*
        control. try the following revised code in the combo box's AfterUpdate
        event, as

        Dim ctl As Control

        For Each ctl In Me.Controls
        If ctl.ControlType = acTextBox Then
        ctl.Locked = IsNull(Me.Combo 0)
        End If
        Next

        hth


        <ApexData@gmail .com> wrote in message
        news:1144599488 .879639.6770@u7 2g2000cwu.googl egroups.com...[color=blue]
        > If I am in a combobox, is there are way of determining which control
        > was clicked outside the combobox, before I actually leave the combobox?
        > I would like to make a decision at the combobox control about what
        > control
        > was clicked outside that box.
        >
        > ThankYou
        >[/color]


        Comment

        • fredg

          #5
          Re: Where Am I?

          On 9 Apr 2006 10:16:41 -0700, ApexData@gmail. com wrote:
          [color=blue]
          > Thankyou for your response Fred.
          > I'm not sure? But I believe your suggestion
          > implies that I have to leave the combobox to
          > get my answer, and this is what I do not want
          > to do. Am I correct?[/color]

          Wouldn't this have been more quickly answered had you just tried it?

          No you are not correct.
          For instance, you can place the code in the combo box Enter event.
          --
          Fred
          Please respond only to this newsgroup.
          I do not reply to personal e-mail

          Comment

          • ApexData@gmail.com

            #6
            Re: Where Am I?

            Thankyou all very much for your responses! I am 2-months into coding
            with access so please be patient. I appreciate the work-around option
            offered by Salad in an earlier post and have used something similar
            before.
            I have tried Freds suggestion but it does not work for me. The Serial#
            combobox
            is the first control entered when the form starts up. So asking for the
            Screen.Previous Control.Name does not work.

            What I specifically want to do, is what I originally asked:
            If I am in a combobox, is there a way of determining which control
            was clicked outside the combobox, before I actually leave the combobox?


            THANKYOU AGAIN

            Comment

            • Bob Quintal

              #7
              Re: Where Am I?

              "ApexData@gmail .com" <ApexData@gmail .com> wrote in
              news:1144605823 .348630.77890@e 56g2000cwe.goog legroups.com:
              [color=blue]
              > Thankyou all very much for your responses! I am 2-months into
              > coding with access so please be patient. I appreciate the
              > work-around option offered by Salad in an earlier post and
              > have used something similar before.
              > I have tried Freds suggestion but it does not work for me. The
              > Serial# combobox
              > is the first control entered when the form starts up. So
              > asking for the Screen.Previous Control.Name does not work.
              >[/color]
              You have not experience enough with Access to have mastered the
              concept in fredg's response, and that is that the moment you
              have clicked outside the combobox you are outside the combobox.
              Fredg's code returns you to the combobox.
              [color=blue]
              > What I specifically want to do, is what I originally asked:
              > If I am in a combobox, is there a way of determining which
              > control was clicked outside the combobox, before I actually
              > leave the combobox?[/color]

              you might as well ask "What is the sound of one hand clapping?"
              (old Zen koan)

              --
              Bob Quintal

              PA is y I've altered my email address.

              Comment

              • tina

                #8
                Re: Where Am I?

                well, to answer your specific question: AFAIK, no.

                hth


                <ApexData@gmail .com> wrote in message
                news:1144605823 .348630.77890@e 56g2000cwe.goog legroups.com...[color=blue]
                > Thankyou all very much for your responses! I am 2-months into coding
                > with access so please be patient. I appreciate the work-around option
                > offered by Salad in an earlier post and have used something similar
                > before.
                > I have tried Freds suggestion but it does not work for me. The Serial#
                > combobox
                > is the first control entered when the form starts up. So asking for the
                > Screen.Previous Control.Name does not work.
                >
                > What I specifically want to do, is what I originally asked:
                > If I am in a combobox, is there a way of determining which control
                > was clicked outside the combobox, before I actually leave the combobox?
                >
                >
                > THANKYOU AGAIN
                >[/color]


                Comment

                • PC D

                  #9
                  Re: Where Am I?

                  Take another look at your previous post ---

                  --
                  PC Datasheet
                  Your Resource For Help With Access, Excel And Word Applications
                  Over 1175 users have come to me from the newsgroups requesting help
                  resource@pcdata sheet.com



                  <ApexData@gmail .com> wrote in message
                  news:1144605823 .348630.77890@e 56g2000cwe.goog legroups.com...[color=blue]
                  > Thankyou all very much for your responses! I am 2-months into coding
                  > with access so please be patient. I appreciate the work-around option
                  > offered by Salad in an earlier post and have used something similar
                  > before.
                  > I have tried Freds suggestion but it does not work for me. The Serial#
                  > combobox
                  > is the first control entered when the form starts up. So asking for the
                  > Screen.Previous Control.Name does not work.
                  >
                  > What I specifically want to do, is what I originally asked:
                  > If I am in a combobox, is there a way of determining which control
                  > was clicked outside the combobox, before I actually leave the combobox?
                  >
                  >
                  > THANKYOU AGAIN
                  >[/color]


                  Comment

                  • Please Stop Advertising

                    #10
                    Re: Where Am I?

                    PC D wrote:[color=blue]
                    > Take another look at your previous post ---
                    >[/color]


                    --
                    To anyone reading this thread:

                    It is commonly accepted that these newsgroups are for free
                    exchange of information. Please be aware that PC Datasheet
                    is a notorious job hunter. If you are considering doing
                    business with him then I suggest that you take a look at
                    the link below first.



                    Randy Harris

                    Comment

                    • fredg

                      #11
                      Re: Where Am I?

                      On 9 Apr 2006 11:03:43 -0700, ApexData@gmail. com wrote:
                      [color=blue]
                      > Thankyou all very much for your responses! I am 2-months into coding
                      > with access so please be patient. I appreciate the work-around option
                      > offered by Salad in an earlier post and have used something similar
                      > before.
                      > I have tried Freds suggestion but it does not work for me. The Serial#
                      > combobox
                      > is the first control entered when the form starts up. So asking for the
                      > Screen.Previous Control.Name does not work.
                      >
                      > What I specifically want to do, is what I originally asked:
                      > If I am in a combobox, is there a way of determining which control
                      > was clicked outside the combobox, before I actually leave the combobox?
                      >
                      > THANKYOU AGAIN[/color]

                      Why didn't you state that it was the first control to get focus in
                      your first message, or even when you replied to my first message?

                      Even in this message, just before the "THANKYOU AGAIN", you DO NOT
                      STATE that it was the first control. We are not mind readers!

                      All you need do is trap the resulting errors.
                      Place the following in the Combo Box's Enter event:

                      Private Sub ComboBoxName_En ter()
                      On Error GoTo Err_Handler
                      If Screen.Previous Control.Name = "SomeContro l" Then
                      ' Do Something Here
                      Else
                      ' Do somthing else here
                      End If

                      Exit_Sub:
                      Exit Sub
                      Err_Handler:
                      If Err = 2483 Or Err = 2467 Then
                      Else
                      MsgBox "Error: " & Err.Number & " " & Err.Description
                      End If
                      Resume Exit_Sub
                      End Sub

                      When done, your code should look just like this example, except the
                      name of your combo box will be where I have "ComboBoxNa me".
                      AND ...
                      Where I have written

                      If Screen.Previous Control.Name = "SomeContro l" Then

                      you will replace "SomeContro l" with the name of the control and you
                      will write the action you wish to perform. You haven't said what it
                      is.

                      When opening the form no error will be generated, nor will any action
                      be done.
                      Only upon re-entering the combo box will the action be performed.
                      --
                      Fred
                      Please respond only to this newsgroup.
                      I do not reply to personal e-mail

                      Comment

                      • Br@dley

                        #12
                        Re: Where Am I?

                        Personally I'd design the user interface better... ie. only show the
                        combobox, or split it over diff forms or pages only going the the second
                        setion once a value has been entered.

                        ... or something like that.

                        fredg wrote:[color=blue]
                        > On 9 Apr 2006 11:03:43 -0700, ApexData@gmail. com wrote:
                        >[color=green]
                        >> Thankyou all very much for your responses! I am 2-months into coding
                        >> with access so please be patient. I appreciate the work-around
                        >> option offered by Salad in an earlier post and have used something
                        >> similar before.
                        >> I have tried Freds suggestion but it does not work for me. The
                        >> Serial# combobox
                        >> is the first control entered when the form starts up. So asking for
                        >> the Screen.Previous Control.Name does not work.
                        >>
                        >> What I specifically want to do, is what I originally asked:
                        >> If I am in a combobox, is there a way of determining which control
                        >> was clicked outside the combobox, before I actually leave the
                        >> combobox?
                        >>
                        >> THANKYOU AGAIN[/color]
                        >
                        > Why didn't you state that it was the first control to get focus in
                        > your first message, or even when you replied to my first message?
                        >
                        > Even in this message, just before the "THANKYOU AGAIN", you DO NOT
                        > STATE that it was the first control. We are not mind readers!
                        >
                        > All you need do is trap the resulting errors.
                        > Place the following in the Combo Box's Enter event:
                        >
                        > Private Sub ComboBoxName_En ter()
                        > On Error GoTo Err_Handler
                        > If Screen.Previous Control.Name = "SomeContro l" Then
                        > ' Do Something Here
                        > Else
                        > ' Do somthing else here
                        > End If
                        >
                        > Exit_Sub:
                        > Exit Sub
                        > Err_Handler:
                        > If Err = 2483 Or Err = 2467 Then
                        > Else
                        > MsgBox "Error: " & Err.Number & " " & Err.Description
                        > End If
                        > Resume Exit_Sub
                        > End Sub
                        >
                        > When done, your code should look just like this example, except the
                        > name of your combo box will be where I have "ComboBoxNa me".
                        > AND ...
                        > Where I have written
                        >
                        > If Screen.Previous Control.Name = "SomeContro l" Then
                        >
                        > you will replace "SomeContro l" with the name of the control and you
                        > will write the action you wish to perform. You haven't said what it
                        > is.
                        >
                        > When opening the form no error will be generated, nor will any action
                        > be done.
                        > Only upon re-entering the combo box will the action be performed.[/color]

                        --
                        regards,

                        Br@dley


                        Comment

                        • ApexData@gmail.com

                          #13
                          Re: Where Am I?

                          In response to Br@dley.
                          I have spent too much time trying to get my original ideas to work.
                          I am now just going to build an input dialogbox containing the
                          Serialnumber ComboBox. This way I have control the entry in isolation.
                          Thanks for your thoughts!

                          Comment

                          • Tim Marshall

                            #14
                            Re: Where Am I?

                            ApexData@gmail. com wrote:[color=blue]
                            > In response to Br@dley.
                            > I have spent too much time trying to get my original ideas to work.[/color]

                            I haven't followed your threads closely, though the
                            screen.previous control does what you want.

                            However, one needs to ask oneself if I am trying to swim from Europe to
                            North America is it impossible to do? If I am having difficulty and
                            someone throws me a life bouy am I being silly by saying "no I've spent
                            too much time trying to make it across, I'll continue" even if it means
                            certain drowning?

                            If someone realizes you are trying to get through a brick wall by
                            banging your head against it and tells you, would you continue banging
                            your head?

                            Just a couple of analogies to consider...
                            --
                            Tim http://www.ucs.mun.ca/~tmarshal/
                            ^o<
                            /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
                            /^^ "What's UP, Dittoooooo?" - Ditto

                            Comment

                            • ApexData@gmail.com

                              #15
                              Re: Where Am I?

                              Unfortunately Marshall, in my case your analogy applies to my effort to
                              get the
                              screen.previous control to work. If your interested in tossing the
                              lifering, show
                              some specific code. This will satisfy more than here!

                              Comment

                              Working...