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?
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?
You bind the combo to the field (by setting the combo's controls source property to the desired field).
Cheers,
combo:
CONTROL SOURCE = field to save the data
ROW SOURCE = query to pick the data LIST
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!
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?
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
oldcelt,
What is latest status? Others have provided answer if your combo gets values from another table.
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.I've created a blank form and added a combo box which I've populated with my typed list of possible actions.
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.
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.
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
Thank you Vlad
Thank you @orange
Thank you @Missinglinq