Results 1 to 6 of 6
  1. #1
    Kat-ness is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26

    Combo Boxes on a form

    I want to create combo boxes on a form for contacts based on a contacts table where the fields I'm using are not combo boxes such as Name, Address, etc.



    I know how to do this initially but I have a few of questions.

    1. Is it possible to do a single combo box to pull all of the relevant information at once and have it show on the table? I tried doing this but the cell keeps winding up blank, even after I've selected the record I want to go in there.
    2. If I set up individual combo boxes to pull up records separately, i.e. one for first name, one for last name, one for phone number, etc. will this make more sense?
    3. When I want to add a new contact record not already in the database, can I just type it into the combo box on the form and have it be saved on my table or is there another way to do this? And if I can do this, will the record be available next time to pull up using the combo box?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    1. A single combobox can display all related information in the RowSource list. What do you mean by 'have it show on the table'? Only the value of the BoundColumn will save to field set as ControlSource.

    2. Only if you want to allow search/filter for any of those values. Review http://datapigtechnologies.com/flash...tomfilter.html

    3. Explore the NotInList event http://support.microsoft.com/kb/197526
    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
    Kat-ness is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26
    Thanks for the explanation and the links, June7. Hmm...'Show on the table' is totally not what I was trying to say so I see why that confused you. What I meant was, how do I get all the selected fields in the Rowsource list to show on that, umm...cell?, in my form. I tried putting in about 7 fields and when I selected the record I wanted in the combobox drop down list the cell remained blank??? I tried it with just one field in the rowsource and the record selection appeared in the 'cell'.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    As to why the selected item would not show in the combobox, would have to know the properties of combobox: RowSource, ControlSource, BoundColumn, ColumnCount, ColumnWidths.

    Or provide db for analysis.
    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
    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
    Sorry, but to be honest, I'm still confused, but if you want to

    • Create a Combobox listing all Contacts
    • Select a Contact using a Field that uniquely identifies the Contact
    • Have that Contact's Name, Address, Telephone Number, etc., automatically fill in Textboxes on your Form

    here's a short example, showing how to do that:

    Set up your Combobox using the Wizard and include the Fields you need, from Left-to-Right.

    If in the Combobox they appear as

    Unique Identifier | Name | Address | Telephone

    the code would be

    Code:
    Private Sub YourComboBox_AfterUpdate()
       Me.txtName =  Me.YourComboBox.Column(1)
       Me.txtAddress = Me.YourComboBox.Column(2)
       Me.txtTelephone= Me.YourComboBox.Column(3)
    End Sub

    The Column Index of a Combobox is Zero-based. The Uniquely Identifying Field, such as an ID field, would be YourComboBox.Column(0) and usually not displayed, merely used to retrieve the data.

    The second Field displayed (reading Left-to-Right) would be YourComboBox.Column(1), the third Field would be YourComboBox.Column(2), and so forth.


    Linq ;0)>

  6. #6
    Kat-ness is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26
    Thanks for all the help on this. Sorry for the late reply, but it's been a busy week! I definitely appreciate the comments.

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Continous Form with Combo Boxes
    By dhogan444 in forum Forms
    Replies: 3
    Last Post: 07-18-2012, 08:04 AM
  3. Sub-Sub Form Cascade Combo Boxes
    By Huddle in forum Access
    Replies: 4
    Last Post: 03-22-2012, 01:42 PM
  4. Help with form & combo boxes
    By rnjalston in forum Forms
    Replies: 1
    Last Post: 03-17-2010, 10:38 PM
  5. Combo boxes on a form
    By Maranna in forum Forms
    Replies: 1
    Last Post: 06-22-2009, 01:48 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