Results 1 to 13 of 13
  1. #1
    oldcelt's Avatar
    oldcelt is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6

    how to save a form combo box selection to a table field

    I have a list of items which I want to show in a combo box on a form. How can I save the selection to a field in a table please?

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You bind the combo to the field (by setting the combo's controls source property to the desired field).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    combo:
    CONTROL SOURCE = field to save the data
    ROW SOURCE = query to pick the data LIST

  4. #4
    oldcelt's Avatar
    oldcelt is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6
    Quote Originally Posted by Gicu View Post
    You bind the combo to the field (by setting the combo's controls source property to the desired field).

    Cheers,
    OK, simple test:
    I have a database; only one table, one of its fields called 'Action taken'.
    I've created a blank form and added a combo box which I've populated with my typed list of possible actions.
    How do I bind the selected combo box item with the 'Action taken' field in the table?

    I can't find any property which enables me to make such a binding!

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You set the Record Source property of the form to your table then you set the Control Source property of the combo to your ActionTaken field.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    oldcelt's Avatar
    oldcelt is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6
    Quote Originally Posted by Gicu View Post
    You set the Record Source property of the form to your table then you set the Control Source property of the combo to your ActionTaken field.

    Cheers,
    OK, I know I'll look a complete idiot to you experts but I'm just a beginner trying to learn Access. This is to keep me amused in my retirement and has no commercial implications.

    Looking at the form Property Sheet, I cannot find a property called 'Record Source'. I wonder if you'd be kind enough to explain in a little more detail please?

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Here you go, no worries, we all had to learn sometimes

    Click image for larger version. 

Name:	Form source.jpg 
Views:	14 
Size:	148.4 KB 
ID:	42055
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    In Form Design

    • Select the Form
    • Go to Properties - Data - Record Source
    • Select the Table or Query the Form is based on
    • *************************************
    • Now select the Combobox
    • Go to Properties - Data - Control Source
    • Select the Field you want to save the Combobox selection to

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #9
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    oldcelt,

    What is latest status? Others have provided answer if your combo gets values from another table.

    I've created a blank form and added a combo box which I've populated with my typed list of possible actions.
    This sounds like you have added a value list - a list of possible values one of which could be selected to populate the field "Action taken" in your table.

    Here is another response --more of a guess since I'm unsure of your set up.
    This is a mock up of a table with 4 records. Each record has id, empname, problem, and ActionTaken.

    This picture was taken after I processed record 1.
    Click image for larger version. 

Name:	tblOldCelt.PNG 
Views:	11 
Size:	14.8 KB 
ID:	42057





    The id, empname and Problem are populated.
    The value for ActionTaken is determined by a selection in cboDemo.
    The afterUpdate event of cboDemo assigns the selected value to "ActionTaken" for that record.

    Click image for larger version. 

Name:	oldcelt_combo_valuelist_table.PNG 
Views:	11 
Size:	33.6 KB 
ID:	42056

    Code:
    Private Sub cboDemo_AfterUpdate()
    Me.ActionTaken = Me.cboDemo  'assign the selected value in cboDemo to 
                                      'the ActionTaken field in current record.
    End Sub
    Last edited by orange; 06-02-2020 at 10:55 AM. Reason: additional info

  10. #10
    oldcelt's Avatar
    oldcelt is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6
    Thank you Vlad

  11. #11
    oldcelt's Avatar
    oldcelt is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6
    Thank you @orange

  12. #12
    oldcelt's Avatar
    oldcelt is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    6
    Thank you @Missinglinq

  13. #13
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    you're very welcome!
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 9
    Last Post: 03-22-2019, 03:11 AM
  2. Replies: 7
    Last Post: 12-09-2014, 12:24 PM
  3. Replies: 17
    Last Post: 02-15-2014, 01:13 AM
  4. Replies: 1
    Last Post: 12-09-2012, 07:11 AM
  5. Replies: 1
    Last Post: 10-25-2012, 12:58 PM

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