M
Mo
I've got an unbound listbox on a form, and for the item that's currently
selected from the listbox, I'm trying to find out how many exist in the
underlying table (i.e. the same as rst.recordcount)
The field I'm using is called CN and is an integer
I'm having problems with the following code and getting a 'Type mismatch'
error message.
Anyone know what I'm doing wrong?
Thanks for any help.
-------------code snippet--------------
For Each varItem In Me.list_main.ItemsSelected
strWhere = "CN = " & Me.list_main.ItemData(varItem) & ""
Next varItem
strSQL = "SELECT CN FROM tblRegistration "
strSQL = strSQL & "WHERE " & strWhere
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
------------------------------
selected from the listbox, I'm trying to find out how many exist in the
underlying table (i.e. the same as rst.recordcount)
The field I'm using is called CN and is an integer
I'm having problems with the following code and getting a 'Type mismatch'
error message.
Anyone know what I'm doing wrong?
Thanks for any help.
-------------code snippet--------------
For Each varItem In Me.list_main.ItemsSelected
strWhere = "CN = " & Me.list_main.ItemData(varItem) & ""
Next varItem
strSQL = "SELECT CN FROM tblRegistration "
strSQL = strSQL & "WHERE " & strWhere
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
------------------------------