Results 1 to 13 of 13
  1. #1
    sidewinder2 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7

    Saving Values from Combo Boxes in a Table

    I am making an Access form with a few combo boxes and text boxes. I have them set up to submit to a table when a button is clicked. The only issue is that the ID numbers from the values in the combo boxes are saved to the table instead of the displayed options in the drop down menu. I was wondering if it is possible to change this. Also, I am new to Access so forgive me if this is a simple issue. I wasn't able to find anything relating to my issue from Google or this forum. Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    If you don't want to save the ID values, don't include field in the combobox RowSource. Is the RowSource referencing a table or is it an SQL statement?

    Are you saving to a number or text field? Is the other data text?
    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
    sidewinder2 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    The RowSource is referencing a table. The other data is text, and it is being saved to a text field.
    Quote Originally Posted by June7 View Post
    If you don't want to save the ID values, don't include field in the combobox RowSource. Is the RowSource referencing a table or is it an SQL statement?

    Are you saving to a number or text field? Is the other data text?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Make the RowSource an SQL statement that selects only the field with data you want to save, like:

    SELECT fieldName FROM tableName;
    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
    sidewinder2 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    I made everything so far using wizards as opposed to VBA, so I am not very familiar with that.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Exactly why I never learned with the wizards. I also don't like what they do (use macros, 'group' controls, etc.)

    You can type SQL statement into the RowSource or click the ellipses (...) to open query builder.
    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.

  7. #7
    sidewinder2 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    Would it be possible for you to send a screenshot of what you are talking about? I'm having trouble visualizing it.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Review http://datapigtechnologies.com/flash...combobox1.html

    How to set RowSource is about halfway through the video.
    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.

  9. #9
    sidewinder2 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    Lovely, that works, but brought up another issue. When the combo box is opened, the options are blank. But you can still select the blank spaces and it works.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    There are no items in the combobox dropdown? Why? Post your RowSource statement.

    What are other properties set to:

    ColumnCount
    ColumnWidths
    BoundColumn
    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.

  11. #11
    sidewinder2 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    RowSource: SELECT Operators.[Machine Operators] FROM Operators ORDER BY Operators.[Machine Operators];

    ColumnCount: 2
    ColumnWidths: 0";1"
    BoundColumn: 1

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Should be:

    ColumnCount: 1
    ColumnWidths: {1 column, no need to set}
    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.

  13. #13
    sidewinder2 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    Success! Thank you very much!!

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

Similar Threads

  1. Saving List box values to a table
    By dccjr in forum Programming
    Replies: 1
    Last Post: 04-16-2013, 05:29 PM
  2. Replies: 1
    Last Post: 09-20-2012, 03:40 PM
  3. Restricting values in combo boxes
    By Remster in forum Access
    Replies: 4
    Last Post: 09-08-2010, 12:24 PM
  4. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  5. Replies: 2
    Last Post: 08-24-2009, 10:36 AM

Tags for this Thread

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