Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Highlighted (MSACCESS 2003)

    I have a combo box on a form. If you tab through other text boxes on a form and arrive on a combo box, it's fully highlighted. I have set all the properties of key behaviour etc, but cannot find how to get it so the cursor lands at the end of the field in the combo box.

    I am also trying to fire an event from the combo being selected or passed through. I only want the event to happen once, during selecting an item or just tabbing through. I cannot seem to find an event in the combo box that works in both. Any suggetstion. Many thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Highlighted (MSACCESS 2003)

    If I set Focus after Move to End of Field in the Keyboard tab of Tools | Options..., the insertion point is placed at the end of the contents in both a text box and a combo box.

    Have you tried the On Got Focus event of the combo box, or the On Enter event? Or do I misinterpret your second question.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Highlighted (MSACCESS 2003)

    Thanks Hans. I have four controls on a form:
    Textbox1
    Textbox2
    Combobox1 - Event wanted in here
    Textbox3

    I want an event to happen when comboxbox1 is either clicked on or passed through. The event checks that both Textbox1 and Textbox2 have been filled in. The event must catch whether the user filled everything in. The problem I have found is when the user has filled everything in and clicks combobox1 then Textbox3 is enabled but if he goes back and clears Textbox1 or 2, and just tabs passed the combobox, it leaves Textbox3 enabled. I cannot find the correct event in the combobox to catch both clicking on it or tabbing passed. If there was one event in the combo that worked for both situations it would be easy

    Also I have set my text behavior to the end of a field but it still stays highlighted when getting the focus.

    Regards

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Highlighted (MSACCESS 2003)

    When exactly should TextBox3 be enabled, and when exactly should it be disabled?

  5. #5
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Highlighted (MSACCESS 2003)

    Thanks, both Textbox1 and Textbox2 to have beeb filled, and a selection made on Combo1. Regards

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Highlighted (MSACCESS 2003)

    You could set the Enabled property of TextBox3 in the After Update event of TextBox1 and TextBox2 and Combo1., checking whether none of the three is blank:

    Private Sub TextBox1_AfterUpdate()
    Me.TextBox3.Enabled = Not (IsNull(Me.TextBox1) Or IsNull(Me.TextBox2) Or IsNull(Me.Combo1))
    End Sub

    Private Sub TextBox2_AfterUpdate()
    Me.TextBox3.Enabled = Not (IsNull(Me.TextBox1) Or IsNull(Me.TextBox2) Or IsNull(Me.Combo1))
    End Sub

    Private Sub Combo1_AfterUpdate()
    Me.TextBox3.Enabled = Not (IsNull(Me.TextBox1) Or IsNull(Me.TextBox2) Or IsNull(Me.Combo1))
    End Sub

    That way it doesn't matter in which order the user passes through the controls.

  7. #7
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Highlighted (MSACCESS 2003)

    Many thanks yet again Hans. I did not see that way through it ,excellent. Have a good day, regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •