Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228

    Would I use the .seltext as in ctrl.seltext? I don't believe that is an option.

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Never tried SelText before in a combo but I saw it in another thread. If we are talking about comboboxes then.... I created a combo and a control button. In the control button's click event I placed...

    Me.Combo5.SetFocus
    Me.Combo5.SelText = "12"
    Me.Combo5.Dropdown

    It was in intelisense in Access 2010. Seems to give the effect the OP is looking for.

  3. #18
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    Actually, it does run, but it doesn't just highlight, it selects that option.

  4. #19
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    I decided to go with the route of using the .dropdown function. I am unsure if the direction I am looking to go is clear or not.

    Say I enter a combobox that is null at the moment, it will automatically run .dropdown. If the first key I press is the up arrow, I would like it to highlight the final option. Whereas if I press the down arrow, it would highlight the first option.

    I do not want to actually select the option, just highlight it. I do not know if this is possible or not.

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Now SelText is showing up. Think I was accidentally referencing a listbox in my code test.

    However, not sure you want it. From Access VBA Help:
    The SelText property uses a string expression that contains the text selected in the control. If the control contains selected text when this property is set, the selected text is replaced by the new SelText setting.

    I tested it and it with an unbound combobox and it simply populated the box with 12 and replaced whatever was already there.

    I believe highlighting IS selecting. That's the way combobox works.

    Page Down goes down one page at a time and Page Up goes up one page at a time.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #21
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    Ya I tested it a couple times and I agree, it does not seem to me that what I am looking for is an option.

  7. #22
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by June7 View Post
    ..I believe highlighting IS selecting. That's the way combobox works.

    ...
    I too believe this is correct. I had 12 in my example because it was an option within my list of options in my combobox

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Listbox "On Not In List" Property
    By kdbailey in forum Access
    Replies: 3
    Last Post: 01-03-2014, 11:11 AM
  2. Replies: 7
    Last Post: 11-08-2013, 08:28 PM
  3. Filter Form with "CurrentRecord" property
    By bbrazeau in forum Forms
    Replies: 3
    Last Post: 05-24-2013, 10:16 AM
  4. Replies: 16
    Last Post: 11-01-2011, 01:35 PM
  5. Replies: 11
    Last Post: 11-26-2010, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums