473,398 Members | 2,812 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,398 software developers and data experts.

data type mismatch?

i have a form "Maintenence-Users" that is linked to the table "Users"

i created a filter combo box with the following
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo23_AfterUpdate()
  2.  
  3.     Dim rs As Object
  4.  
  5.     Set rs = Me.Recordset.Clone
  6.     rs.FindFirst "[win_id] = " & Str(Nz(Me![Combo23], 0))
  7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  8.  
  9. End Sub
  10.  
win_id - text - is the primary key

the rowsource of the combo box is
Expand|Select|Wrap|Line Numbers
  1. SELECT users.win_id, users.First_Name AS [First Name], users.Last_Name AS [Last Name], users.Office
  2. FROM users
  3. ORDER BY users.Last_Name;
  4.  
but im still getting a mismatch?

Thanks!
Jul 28 '11 #1

✓ answered by NeoPa

Your line #6 should be :
Expand|Select|Wrap|Line Numbers
  1.     rs.FindFirst "[win_id] = '" & Nz(Me.Combo23, 0) & "'"
Str() had no effect as that was already handled automatically by the VBA. It was the SQL that was complaining as it had no way of knowing your literal was a text value (See Quotes (') and Double-Quotes (") - Where and When to use them).

7 5000
NeoPa
32,556 Expert Mod 16PB
Your line #6 should be :
Expand|Select|Wrap|Line Numbers
  1.     rs.FindFirst "[win_id] = '" & Nz(Me.Combo23, 0) & "'"
Str() had no effect as that was already handled automatically by the VBA. It was the SQL that was complaining as it had no way of knowing your literal was a text value (See Quotes (') and Double-Quotes (") - Where and When to use them).
Jul 28 '11 #2
wow neoPa, thanks a bunch! problem solved :)
Jul 29 '11 #3
NeoPa
32,556 Expert Mod 16PB
A pleasure Jeffrey.

I'm finding most of your questions make sense (mainly) and seem to include the relevant data. This makes answering so much more pleasant. You keep putting the effort into posting sensible questions and I'll do the same for finding the answers ;-)
Jul 29 '11 #4
@NeoPa:

I really admire your talents NeoPa. :D

I did learn one thing though - before coding, always draw diagrams/flowcharts and plan it out first. I think I have become a better programmer. I only had a semester of SQL in my freshmen year of college, so I'm still in the learning process.

I do have another unrelated question if you have any inputs you would like to contribute :P

So this whole database (where I've been making tons of questions) is a problem-tracking database where my colleagues keep track of user & printer problems.

I would like to know if there are any notable features that a problem tracking database must have? I have researched a bit on issue-tracking systems: http://en.wikipedia.org/wiki/Compari...acking_systems but I can't seem to narrow it down to name a few features a problem tracking database must have.

Thanks in advance!
Jul 29 '11 #5
NeoPa
32,556 Expert Mod 16PB
Jeffrey, I can't help you with this I'm afraid.

If you're serious about wanting to ask it then I suggest you post a new thread for it (which is how questions must be asked here - 1 per thread). It's not something I'd be likely to get involved in though, even if I do have a dig around in my brain to see if I can come up with something.

I doubt you'll want for suggestions though. Many others are likely to have been there before you.
Jul 29 '11 #6
@NeoPa:

good idea. i just feel that i've been posting too many questions lately so i don't want to spam the board :)
Jul 29 '11 #7
NeoPa
32,556 Expert Mod 16PB
That's not a worry Jeffrey. As long as each question is thought out in advance and presented properly with all the relevant data (as yours tend to be anyway, according to your current understanding) then they are all valid. There are a couple of threads at the top of the forum that outline the things that should be included, as well as those to be omitted. Keep to those guidelines and you can ask away happily.
Jul 29 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chicken Kebab Abdullah | last post by:
Does anyone know why I get the error 3464 Data type mismatch from the following code. I have a form with a combo(to choose a consumable) and 2 list boxes on it. list on left is all printers...
0
by: news.paradise.net.nz | last post by:
I have been developing access databases for over 5 years. I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query...
1
by: ArcadeJr | last post by:
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...
3
by: Jake | last post by:
I am currently trying to create my own Point Of Sale software for my retail store. I wrote the program with the UPC field as Long integer. When I started to add the products by UPC code, I got a...
1
by: amitbadgi | last post by:
I am getting the following error while converting an asp application to asp.net Exception Details: System.Runtime.InteropServices.COMException: Data type mismatch in criteria expression. ...
2
by: psychomad | last post by:
Please, can someone help me out to solve this error, i've been searching throughout my codes and yet i didnt succeed in finding the error!!!! The Error is: Server Error in '/' Application....
19
by: Lysander | last post by:
I have written a query that takes three integers representing day,month and year, forms a date from them and compares this date to the date the record was entered and returns any records where the...
3
by: Bruce Lawrence | last post by:
I've got a form that when it opens it prompts the user for 2 peices of information. The Asset and the Date. getasset = InputBox("Enter the Asset Number") If getasset = "" Then Exit Sub Else...
1
by: Bobby Edward | last post by:
Using Access db with VS2008 (ASP.NET/VB.NET).... On the INSERT command I get this error: System.Data.OleDb.OleDbException: Data type mismatch in criteria expression. I haven't found a...
2
by: hype261 | last post by:
So I have a SQL Query I am trying to author and it keeps giving me a Data Type mismatch error which I can't seem to see. Exact error message is Data type mismatch in criteria expression. Here is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.