Results 1 to 8 of 8
  1. #1
    DigitalAdrenaline is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    100

    How To Allow A Button To Open The Value List

    Hi Guys, I've created a form with a Combo Box. Instead of Right-Clicking the Combo box to open the Edit Value list, is the there a VBA code or Macro that will allow me to open this on clicking a form button for a user? Thanks.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    If you are going to allow edits to your list, why keep them as a value list? Why not have a table with the options and let your users add items to that list instead. Value lists are fraught with problems and should be used sparingly and on lists that won't change over time (opinion).

  3. #3
    DigitalAdrenaline is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    100
    I was thinking about setting up tables. But each Combo Box list only contains several entries each. I was wondering if tables might be overkill. But I see your point.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    You do not need a separate table for each 'list'. What I do is have a table of options (tblOption) that looks something like this

    Opt_ID (PK autonumber)
    Opt_Group
    Opt_Desc
    Opt_Sort
    Date_Added

    and the data looks like

    Opt_ID Opt_Group Opt_Desc Opt_Sort Date_Added
    6
    GeneralYN
    9/9/2014 2:25:01 PM
    10 6 Yes 1 9/9/2014 2:28:14 PM
    11 6 No 2 9/9/2014 2:28:16 PM

    or

    Opt_ID Opt_Group Opt_Desc Opt_Sort Date_Added
    27
    Race
    11/15/2014 2:01:52 PM
    31 27 Asian 1 11/15/2014 2:10:47 PM
    30 27 Black 2 11/15/2014 2:10:43 PM
    29 27 Caucasian 3 11/15/2014 2:10:40 PM
    33 27 Multiracial 4 11/15/2014 2:42:37 PM
    236 27 Pacific Islander 5 9/15/2015 1:10:16 PM


    So you set up your group first, then you can populate it with your 'options' under that group

    This allows you to store all your simple options in one table

  5. #5
    DigitalAdrenaline is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    100
    Thanks. I follow what you're saying. The Combo Box I've set up contains stock exchanges: Australia, US, UK. But another user may wish to amend the list to include Hong Kong or delete UK. Rather than me create a table of 50 exchanges, of which, most people won't use. That's where I was going with it, simply a short editable list. I did stumble onto finding the Macro for it: EditListItems, I think.

  6. #6
    DigitalAdrenaline is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    100
    Speaking of Macros. I have an 'Add' button on my main form to add a new data entry. When the Add form opens, my 'Add entry' button has an OnClick Macro sequence: Add Record, GoToRecord new, but I'm unsure how to refresh the combo box list on my first form so the dropdown list contains my new entry. Any suggestions how I might achieve this? Cheers.

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    That's the thing with a value list, unless you save the form, the value list will not change when you close it, you have to force a save with your code along with the value list change. Additionally, if you modify the value list on a single form it does NOT propagate across other forms/reports, it is only useful for the single object (form/report).

  8. #8
    DigitalAdrenaline is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2012
    Posts
    100
    Ahh, ok. That answers a lot rpeare. Then I might just create tables for these combo boxes.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 02-15-2015, 11:51 AM
  2. Replies: 3
    Last Post: 10-20-2014, 03:25 PM
  3. Replies: 1
    Last Post: 05-31-2013, 08:53 AM
  4. Open Report From List Using Combo Box
    By burrina in forum Forms
    Replies: 5
    Last Post: 11-20-2012, 10:20 AM
  5. Open website from list box
    By kev921hs in forum Programming
    Replies: 4
    Last Post: 05-24-2010, 01:43 AM

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