473,375 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,375 software developers and data experts.

Run-time Error message #3464 - Data Type mismatch in criteria expression

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

Nov 13 '05 #1
1 6517
So assetNumber, now text, needs quotes in the WHERE clauses
ie.
SELECT Equipment.* AS expr, Equipment.Asset_Number
FROM Equipment
WHERE
(((Equipment.Asset_Number)="[Fo*rms]![Query_Menu]![AssetNumber*]"));

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James | last post by:
Hi, I would like to run a custom script on a linux box via a button on a php page (php webpage hosted on the same linux box). Is this possible? If so , can you give me a pointer in the right...
4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
2
by: Jenna Olson | last post by:
Hi all- I've never seen this particular issue addressed, but was wondering if there's anything to support one way or another. Say I have a class: class ManipulateData { public:...
7
by: erniedude | last post by:
Hi, I'm a newbie and I was wondering if anyone knew a (Python) script to run 4 batch files, one after the other (assuming the directories are known). It would be better if all 4 batch files...
4
by: Wasi Rehman | last post by:
hi friends, I have one webservice which i want to run on win98 system because some reference in that webservice only run in win98, and my ASP.net application is on win2000 pro. I want to call that...
2
by: Dan | last post by:
Hello, I am just now converting from the world of DOS. Making simple VB.NET apps was easier than I expected. Now I need some control over the window that the app is running in. Can a VB.NET...
2
by: kk.simhadri | last post by:
Hi everybody, I want to run a bat file which is on different PC in the same network. I am able to run a batch file in my PC through the following code <% set wshell =...
26
by: Chief | last post by:
Hello i would like to know which syntax do i have to use in order to make a program run other *.exe program and also how to put inputs in it for example i want to to make a program that run...
8
by: Sean DiZazzo | last post by:
Is there something special you have to do to get a wxPython app to run remotely under xwindows? My Tkinter apps always automatically work that way, so I was surprised to even be confronted with...
16
by: maya | last post by:
hi, this is very annoying.. this is on IE7/Vista.. whenever I load a pg with JavaScript on it IE refuses to run the JavaScript (I'm talking about JavaScript written BY ME....;) and the weird...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.