Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2012
    Posts
    23

    Create drop down box in form


    Dear all,

    I created a from like attachment but want to include a dropdown box where i can select values (see other picture in attachment. Anybody a clue on how i can do this?

    Dear regards,
    Marc
    Attached Files Attached Files

  2. #2
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    Look into combo boxes, you can either enter values to show or get them from a source (table)

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    offie is correct, of course, the Combobox Control is the way to go! In Form Design View, go to the Ribbon - Design Tab - Controls, click on the Combobox Icon and place it on the Form. The Combobox Wizard will walk you through the setting it up.

    Some points to consider when using a Combobox


    Selecting a Row Source Type for your Combobox:

    • If you're absolutely sure that the items to be displayed, in the Combobox, will never change, and are reasonably small in number, use a Row Source Type of Value List; you'll be asked to type in these Values. Adding or deleting items from a Value List, at a later date, will require an Access developer going back into Design View of the Form.
    • If the conditions given above are not true, use a Row Source Type of Table/Query. If items need to be added or deleted, at a later date, this can be done by a user doing so through a Form based on the Table or Query, or directly through the Query.


    If the selection made from the Combobox is to be used to populate a Field in the Form's RecordSource:

    • If it is not possible that items will ever be deleted from the Table or Query that feed the Combobox, you can Bind the Combobox directly to that Field.
    • If, on the other hand, it is possible that items will be deleted from the Table or Query that feed the Combobox, but that these deleted items will still need to be displayed as a part of active Records do not Bind the Combobox directly to that Field! Instead, assign the Value of the selected item to a Textbox on the Form, using the AfterUpdate event of the Combobox, and have this control Bound to that Field.

    To understand the second set of considerations, above, imagine that you have a Form used to enter data about a company's projects. You create a Record for a new project and select the supervisor's name from 'Supervisor Combobox.' If you Bind the selection from the Combobox directly to the Supervisor Field in the underlying Table/Query, and at a later date that supervisor leaves the company, you don't want his name to still appear in the Combobox. Some nimnutz might accidentally assign a supervisor, who no longer works for the company, to a new project! So you arrange for the supervisor's name to no longer appear as a selection in the Combobox. The aforementioned human-bean is now prevented from assigning a new project to a non-existent supervisor! Good! Problem solved!

    Well, that problem is solved! But when you now look at any projects that were assigned to this supervisor, and look at the Combobox, to see who the supervisor was, the Combobox is blank, because that supervisor's name is no longer in the Combobox! That's the time you need to use the second method above, and assign the item selected from the Combobox to a Textbox on the Form that is Bound to the Field in the underlying Table or Query. While the supervisor's name no longer appears in the Combobox, it will still appear in the Textbox that it was assigned to!

    Linq ;0)>

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

Similar Threads

  1. Replies: 2
    Last Post: 04-17-2013, 02:12 PM
  2. Create Dynamic Drop Down Menu
    By jmfranqui in forum Access
    Replies: 1
    Last Post: 02-02-2012, 12:11 AM
  3. Replies: 3
    Last Post: 12-30-2011, 01:20 PM
  4. Replies: 3
    Last Post: 11-29-2011, 07:01 AM
  5. I can't create a drop-down list box
    By cpuser in forum Access
    Replies: 4
    Last Post: 02-18-2008, 10:11 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