473,395 Members | 1,474 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,395 software developers and data experts.

Data type mismatch on recordsource

Im a 3rd year computer science student. I am using adodc on my project, i dont know whats wrong, I'm trying to set the recordsource of my adodc, and trying to filter my database with a criteria that has an integer datatype. . .i think i have tried everything:

me.Adodc1.Recordsource = "Select * from tbltrans where Service_Tag = '" & me.Text1.text & "' "

me.Adodc1.Recordsource = "Select * from tbltrans where Service_Tag = '" + val(me.Text1.text) + "' "

me.Adodc1.Recordsource = "Select * from tbltrans where Service_Tag = ' me.Text1.text ' "

when i try to debug my code, i reaized that it could get the value of of the textbox or the variable, but it always say "Datatype mismatch" . . .
i need some help,
Mar 3 '10 #1

✓ answered by vb5prgrmr

If it is a number then don't use the single ticks (') to surround your value...

Expand|Select|Wrap|Line Numbers
  1. strSQL = "SELECT * FROM tablename WHERE numericfieldname = " & Val(Trim(Text1.Text))
  2.  


Good Luck

2 2636
vb5prgrmr
305 Expert 100+
If it is a number then don't use the single ticks (') to surround your value...

Expand|Select|Wrap|Line Numbers
  1. strSQL = "SELECT * FROM tablename WHERE numericfieldname = " & Val(Trim(Text1.Text))
  2.  


Good Luck
Mar 3 '10 #2
It worked. . .i'm really ;lucky to have discovered this site. . .
hehehe
Mar 6 '10 #3

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

Similar topics

1
by: Sunil Korah | last post by:
I am having some trouble with opening recordsets. I have used code more or less straight from the access help. But still I am getting some errors. I am unable to work out what exactly I am doing...
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. ...
1
by: ApexData | last post by:
Access2k I WAS getting the following error when using the MID function: Run Time Error '13' Type Mismatch I have a new single form, unbound with 1-button on it that uses the following code:...
3
by: Darin | last post by:
I have a problem I just can't figure out. I have a form with a subform, and the recordsource of the subform has criteria based on some unbound fields in the parent form so that data in the parent...
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....
15
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the...
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...
2
by: tiiim | last post by:
hi all i created two textboxes to insert date and a button..i hv this following code for that button..but when i ran error msg shows error like 'runtime error 13' & type mismatch..i hv no idea...
2
by: tmoon3 | last post by:
Hello, This must be a simple mistake, but for some reason I cannot seem to get around it. I am simply trying to create a report of all employees that have a date filled in in a training column...
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: 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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.