473,320 Members | 2,161 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,320 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 6513
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.