Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365

    Using unbound combo box

    It doesn't show item 1 until clicked and then a ghost-like thing appears offering to "Edit List"


    Can that be prevented, and item 1 show automatically ?
    Thanks.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I am not understanding the "ghost-like" thing. Maybe you should provide an image or the db.
    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.

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    that's to bring up the edit dialog for value lists. you can shut it off in the property sheet
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Ah, that would be the Allow Value List Edits property. Set it to No.

    The "ghost-like" thing is either the popup prompt asking if you want to edit list or the list editor - not sure which you meant.

    What is Limit To List set for?
    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.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    To select first item in row source:
    Code:
    Me.ControlName = Me.ControlName.ItemData(0)
    https://www.fmsinc.com/microsoftacce...ect-first.html
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    Thanks for the replies, slowly getting it doing what I want.
    But puzzled by it's click event. It seems to fire only on the dropdown list.
    It's set to null to remove any previous value. I was using only
    Code:
     Do While mycbo.ListCount > 0
        mycbo.RemoveItem (0)
        Loop
    But that did not remove any first (single) item. The null does.
    Whether there's anything showing or not, can I detect a click without having it dropdown first?

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Apparently not. GetFocus will trigger.

    What are you trying to do? Why do you want to remove items?
    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.

  8. #8
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    I tried got focus, click and Mouse up events. Nothing.
    It's an unbound combo box (value/list) and I'd like to get a event working when you click on it (before/without using the dropdown)
    Remove items was something else (needed to clear it before assigning new values). That's sorted.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Can't have what isn't there.

    I still don't know why you want this.
    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.

  10. #10
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    >I still don't know why you want this.

    I want to run some code if the user clicks it. But if it can't be done I'll find some other way.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    But what code? What does this code do? If we know the ultimate goal perhaps we can help find a solution.
    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.

  12. #12
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    Sorry June, understood. I haven't written anything yet, just seeing what might work. It was a textbox and its click event (if it was empty) would access a audio file and fill in some specs about it .
    I converted it to a combo because the field it was bound to might contain a csv. The combo box could then split it to separate lines. But I want to keep the original click event working.
    Which probably means another control just for that. A click on the empty cbo would have worked nicely as it's only needed if it's empty.
    Also thinking about using both controls with just the one needed being visible.

  13. #13
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Making a textbox and combobox work together has been called a "composite" control and is one way to deal with cascading combobox on continuous form. Seems like it would be suited to your situation as well. Size combobox so its textbox area has no width and position a textbox next to the combobox dropdown. Set combobox TabStop No.
    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.

  14. #14
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    Thanks, I'm just giving that a tryout. Is the idea (when you click the dropdown) its textbox area resizes to the textbox width?

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Oops, forget that part about sizing the combobox. Sit textbox on top of combobox text area. Set combobox as TabStop No. If combobox was created last, use right click > Position > Bring to Front on textbox.
    Last edited by June7; 02-09-2024 at 08:19 PM.
    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.

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

Similar Threads

  1. Not in list for unbound combo box
    By lefty2cox in forum Programming
    Replies: 3
    Last Post: 01-28-2023, 04:08 PM
  2. Replies: 6
    Last Post: 04-15-2019, 09:03 PM
  3. Replies: 5
    Last Post: 01-07-2019, 01:51 AM
  4. Unbound combo box
    By pinegrove in forum Access
    Replies: 1
    Last Post: 09-02-2016, 08:14 PM
  5. Capture 2nd Value in an unbound Combo.
    By sesproul in forum Forms
    Replies: 5
    Last Post: 04-30-2010, 02:07 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