Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511

    Question Unanswered: Any way to hide VBA change of focus?

    My Access 2000 form has a combo box with two values, for illustration: REGION A and REGION B. I have a command button with VBA code that first checks the combo box text. I find that I must change the focus to the combo box to check the value, and my code then removes the focus. This action briefly highlights the text until my code removes the focus from the text box.

    Question: can I hide the "highlighting" of the combo text box.

    Thanks.
    Jerry Dale

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Yes, a peculiar problem that access presents (that vb does not). Anyway, if you modify the change event of your combo box and the click event of the command button to the following:

    ComboXXX.SelStart = 0 'this will eliminate the highlight

    Let me know if this is not exactly what you were trying to fix.

  3. #3
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511
    Your suggestion to move the cursor to the begining of the text with 'ComboXXX.SelStart = 0' to eliminate the highlighting of text is a satisfactory solution for me.

    Thanks the the tip.

    The following would be on my wish list for future versions of VBA:
    1) A cursor.visible = False would be a convenient tool to hide the cursor vertical bar when a text box temporarily receives the focus in Access VBA
    2) A property to change the cursor color (white on a white background to make it invisible)
    3) A property to change the cursor to something short and narow

    Are you listening, Microsoft?

Posting Permissions

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