G
Guest
I am teaching myself VB and it is not going well. I thought I found what I
needed on another web site and I altered the code to reflect my database and
it is not working. I keep getting a data type mismatch.
My form has 5 list boxes. Each of the boxes is based on another table and
most have more than one column. For example the Investigator table has the
primary key and the first and last names. The first column is the bound colum
and the other two are displayed. The table that the report is nuilt on is
mainly llokup fields to these tables and thus they are numeric fields.
The code I am using is as follows:
For each varItem in Me.lastName.Itemselected
strName = strName & ",'" & MelastName.ItemData(varItem) & "'"
Next varItem
If Len(strName) = 0 Then
strName = "Like '*'"
Else
strName = Right(strName, Len(strName) -1)
End If
I am using Access 2002
needed on another web site and I altered the code to reflect my database and
it is not working. I keep getting a data type mismatch.
My form has 5 list boxes. Each of the boxes is based on another table and
most have more than one column. For example the Investigator table has the
primary key and the first and last names. The first column is the bound colum
and the other two are displayed. The table that the report is nuilt on is
mainly llokup fields to these tables and thus they are numeric fields.
The code I am using is as follows:
For each varItem in Me.lastName.Itemselected
strName = strName & ",'" & MelastName.ItemData(varItem) & "'"
Next varItem
If Len(strName) = 0 Then
strName = "Like '*'"
Else
strName = Right(strName, Len(strName) -1)
End If
I am using Access 2002