Here
Code:
Dim strCriteria, task As String
Task is declared as a string and strCriteria defaults to a variant type.
You MUST explicitly declare variables
Code:
Dim strCriteria As String, task As String
"TIME" is a reserved word and a built in function in Access and shouldn't be used as an object name.
You MUST concatenate variables to create the string
Code:
SELECT * from Assets where Asset.ID like *" & me.txtbox2 & "* OR Asset.Trucks like *" & me.txtbox2 & "* OR Assets.odometer Like *" & me.txtbox2 & "*;"
I'm going to guess that "ID" is a number and the other two fields are text. With text, you MUST to use delimiters; numbers do not need delimiters.
The key word "LIKE" is not useful for numbers: (this is untested)
Code:
SELECT * FROM Assets WHERE Asset.ID = " & me.txtbox2 & " OR Asset.Trucks LIKE '*" & me.txtbox2 & "*' OR Assets.odometer LIKE '*" & me.txtbox2 & "*' ;"