Hello,
Using VBA in Access 2000, I know how to change the RowSource property in a form. But when I save the form, close the database, and open it and and the form again, the RowSource (pull-down menu for a combo box) is back to the way it used to be. I'm using the list-of-values string for the combo box:
"First Value";"Second Value";"Third Value"
Setting form_MyForm.cboMyField.RowSource equal to that string works fine. However, it doesn't seem to stick, like I said. I presume one must change it in the actual table that is the data source for the combo box. Because I created this combo box field in a table, then used it in a form, so it brought its combo box attributes and properties with it. However, I think I need to change those properties by referencing the table field, not the form field, if I want to save the changes.
In a nutshell, here's my question. When I create a table, and create a field in it, and go to the Lookup tab in the field's properties, I can set the Display Control field to Combo Box, Row Source Type to Value List, and Row Source to "First Value";"Second Value";"Etc." Using code, how do I change that Row Source string? Keep in mind that I'll need the full code to reference the field itself, let alone the property, as I'm not very familiar with ADO and ADODB referencing.
-Christopher
Using VBA in Access 2000, I know how to change the RowSource property in a form. But when I save the form, close the database, and open it and and the form again, the RowSource (pull-down menu for a combo box) is back to the way it used to be. I'm using the list-of-values string for the combo box:
"First Value";"Second Value";"Third Value"
Setting form_MyForm.cboMyField.RowSource equal to that string works fine. However, it doesn't seem to stick, like I said. I presume one must change it in the actual table that is the data source for the combo box. Because I created this combo box field in a table, then used it in a form, so it brought its combo box attributes and properties with it. However, I think I need to change those properties by referencing the table field, not the form field, if I want to save the changes.
In a nutshell, here's my question. When I create a table, and create a field in it, and go to the Lookup tab in the field's properties, I can set the Display Control field to Combo Box, Row Source Type to Value List, and Row Source to "First Value";"Second Value";"Etc." Using code, how do I change that Row Source string? Keep in mind that I'll need the full code to reference the field itself, let alone the property, as I'm not very familiar with ADO and ADODB referencing.
-Christopher