Guest_imported
New member
- Jan 1, 1970
- 0
The following code should limit combo2 list entries depending on what is
chosen in combo1.
(In combo 2 Got focus Event)
Dim str As String
Dim sqlstr As String
str = combo1
sqlstr = "SELECT DISTINCTROW table1 .[field1], table1 .[field2] FROM table1
WHERE (((table1 .[field2])= " & Chr(34) & str & Chr(34) & ");"
combo2.RowSource = sqlstr
This works in a form that is NOT a sub-form. However the message:
"The Microsoft Jet database engine cannot find the input table or
query'~sq_<subformname>~sq_c<combo2name>'. Make sure it exists and that its
name is spelled correctly."
occurs if this code is in a subform (datasheet view) within a main form.
Going into form design view and back onto form view solves the problem, but
we can not work out why this is not working?
Thanks in advance for any help,
Kate [sig][/sig]
chosen in combo1.
(In combo 2 Got focus Event)
Dim str As String
Dim sqlstr As String
str = combo1
sqlstr = "SELECT DISTINCTROW table1 .[field1], table1 .[field2] FROM table1
WHERE (((table1 .[field2])= " & Chr(34) & str & Chr(34) & ");"
combo2.RowSource = sqlstr
This works in a form that is NOT a sub-form. However the message:
"The Microsoft Jet database engine cannot find the input table or
query'~sq_<subformname>~sq_c<combo2name>'. Make sure it exists and that its
name is spelled correctly."
occurs if this code is in a subform (datasheet view) within a main form.
Going into form design view and back onto form view solves the problem, but
we can not work out why this is not working?
Thanks in advance for any help,
Kate [sig][/sig]