Good morning all!
I have been getting a Run-time Error message #3464 - Data Type mismatch
in criteria expression. While trying to run a query.
I have a database where the field Asset_Number was once a type Number,
but I had to change it to a type Text due to I needed to have two zeros
at the beginning of the Asset Number (EX: 001234.)
The rease I am writing is that now when I run from My Query Menu a
choice called "05 - Specific Assets (Choose Assets from List)", where
the user can choose which assets the user wants to view on a report,
just by clicking on the list box called AssetNumber, that is on the
Query Menu.
The Row Source for the List box has the following information:
SELECT DISTINCTROW Equipment.Asset_Number
FROM Equipment;
The After Update information for the AssetNumber List Box has the
following info:
Private Sub AssetNumber_AfterUpdate()
Dim strSql As String
Dim intI As Integer
Dim strSelectedValues As String
strSql = "Select * from Equipment where ("
With Me.AssetNumber
For intI = 0 To .ListCount - 1
If .Selected(intI) Then
strSelectedValues = strSelectedValues & " Or " &
"(([Asset_Number])= " & .ItemData(intI) & ")"
End If
Next intI
End With
strSelectedValues = Trim(Right(strSelectedValues,
Len(strSelectedValues) - 4))
Me.txtWhereClause = strSql & strSelectedValues & ");"
End Sub
There is also a Query called AssetQuery that is associated with this:
SELECT Equipment.* AS expr, Equipment.Asset_Number
FROM Equipment
WHERE (((Equipment.Asset_Number)=[Forms]![Query_Menu]![AssetNumber]));
Finally, the form that is suppose to show the Assets, but when I try to
run the report from the Query Menu, I get that Data-type mismatch
error.
Any ideas?
Jerry Schwartz
Ar******@hot-shot.com