I have a form with several comboboxes whose contents I'm trying to
initialize from a table. The table, ComboSelections, has 3 fields,
an autonumber ID and two text fields, ListCode and ListEntry. ListCode
contains the actual names of the comboboxes, each of which has several
ListEntry values. Here for example is the part of the table that
'defines' the cboQuality_rating combobox:
Id ListCode ListEntry
1 cboQuality_rating Excellent
4 cboQuality_rating Adequate
5 cboQuality_rating Fair
6 cboQuality_rating Limited
7 cboQuality_rating Poor
I've created a single stored query for the row source of each of these
comboboxes:
---------------------------
SELECT ComboSelections.ListEntry
FROM ComboSelections
WHERE (((ComboSelections.ListCode)=[forms]![datasystem]![thisList]));
thisList is a global variable in form datasystem [I note now that in the
way I was hoping to do this, a local variable in the onload sub of the
function should be sufficient].
If I try to use Me!thisList in the WHERE clause above, it gets
interpreted as a parameter: this, too I don't understand.
Then I try to use this scheme: I will fill the comboboxes when loading
the form:
Private Sub Form_Load()
thisList = cboQuality_rating.Name
cboQuality_rating.Requery
Debug.Print "LOADING FORM: thisList = *" & thisList & "*"
End Sub
In the immediate window I do get LOADING FORM: thisList = *cboQuality_rating*
But nothing gets loaded into the combobox. What am I doing wrong?
thanks, --thelma