Hello Guys,
Here is my code:
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim cnn As ADODB.Connection
Set cnn = CurrentProject.Connection
rs.ActiveConnection = cnn
rs.LockType = adLockReadOnly
rs.CursorType = adOpenDynamic
Dim strSQL As String
'Define Query and Run it
'CASE 1: For TireWidth
'If (Len(Nz(txttirewidth, "")) > 0 And Len(Nz(txttirewidthop, "")) > 0 And Len(Nz(txttirewidthvalue, "")) > 0) Then
strSQL = "SELECT TOP 10
Here is my code:
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim cnn As ADODB.Connection
Set cnn = CurrentProject.Connection
rs.ActiveConnection = cnn
rs.LockType = adLockReadOnly
rs.CursorType = adOpenDynamic
Dim strSQL As String
'Define Query and Run it
'CASE 1: For TireWidth
'If (Len(Nz(txttirewidth, "")) > 0 And Len(Nz(txttirewidthop, "")) > 0 And Len(Nz(txttirewidthvalue, "")) > 0) Then
strSQL = "SELECT TOP 10
- .[Field3],
- .[Field7] FROM List WHERE (
- .[Field3] Like(" * " & Me!txttirewidthvalue & " * " ))"
rs.Open strSQL
'lstResult.RowSource = vbNullString
rs.MoveFirst
Do While Not rs.EOF
lstResult.additem rs![Field3]
rs.MoveNext
Loop
rs.Close
'End If
I want to use the value from textbox txttirewidth in the like operator.
I am getting a data type error. I am not able to resolve it.
Thanks in advance,
Nikhil
- .[Field3] Like(" * " & Me!txttirewidthvalue & " * " ))"
- .[Field7] FROM List WHERE (