[RESOLVED] string columnname and using with rst![stringedcolumnname]
Hello there,
i've stringed a Columnname from a particular table
e.g,
Dim sQ As String
sQ = List2.ItemData(List2.ListIndex) '(e.g, value "Set Up")
'prior exists an SQL
List1.AddItem rst![sQ]
However, an error message "Item cannot be found in the...." appeared.
How can i successfully string the column name, and still use it with rst![stringed-column-name]?
Note: MS Access VBA 03
Thanks
Astro
Re: string columnname and using with rst![stringedcolumnname]
You need to use the alternative method of specifying field names, eg:
List1.AddItem rst.fields(sQ)
for a known field name you would do this:
List1.AddItem rst.fields("fieldname")
Re: string columnname and using with rst![stringedcolumnname]
and si_the_geek strikes again
=)
Astro