Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the Rowsource property in a table field

Status
Not open for further replies.

cthaxter

Programmer
Aug 2, 2001
71
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top