473,320 Members | 1,600 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.

A2K - error for this query is very strange!

Ok, so I have this query;

Set rsjobs = dbs.OpenRecordset("SELECT tblSupport.Name, tblSupport.JobNo
FROM tblSupport WHERE (((tblSupport.Name)=" & Forms!frm_SupportFT!txtName &
") AND ((tblSupport.JobNo)>=0));")

Which creates an error;

??4????>?????? 3633
If I create the query separately and run it all is well.

What gives??

thanks
Martin
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003
Nov 12 '05 #1
2 1427
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Put single quotes around the Form value. E.g. (I got rid of those
pesky parentheses that Access likes to put into the WHERE clause):

tblSupport.Name = '" & Forms!frm_SupportFT!txtName & "' AND

Or you could add the PARAMETERS statement to your query (I got rid of
the table references & pesky parentheses for clarity's sake):

PARAMETERS Forms!frm_SupportFT!txtName Text;
SELECT Name, JobNo
FROM tblSupport
WHERE Name = Forms!frm_SupportFT!txtName
AND JobNo >= 0

HTH,

MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP6FxL4echKqOuFEgEQIMqACgsrRPzgl9fzYtWJ3oDbzYZF ZobsYAnR8e
1ta5I8mwa33OvRz/nVJZ63Jw
=L4eZ
-----END PGP SIGNATURE-----
Deano wrote:
Ok, so I have this query;

Set rsjobs = dbs.OpenRecordset("SELECT tblSupport.Name, tblSupport.JobNo
FROM tblSupport WHERE (((tblSupport.Name)=" & Forms!frm_SupportFT!txtName &
") AND ((tblSupport.JobNo)>=0));")

Which creates an error;

??4????>?????? 3633
If I create the query separately and run it all is well.

What gives??

thanks
Martin
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003


Nov 12 '05 #2
MGFoster wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Put single quotes around the Form value. E.g. (I got rid of those
pesky parentheses that Access likes to put into the WHERE clause):

tblSupport.Name = '" & Forms!frm_SupportFT!txtName & "' AND

Or you could add the PARAMETERS statement to your query (I got rid of
the table references & pesky parentheses for clarity's sake):

PARAMETERS Forms!frm_SupportFT!txtName Text;
SELECT Name, JobNo
FROM tblSupport
WHERE Name = Forms!frm_SupportFT!txtName
AND JobNo >= 0

HTH,

MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP6FxL4echKqOuFEgEQIMqACgsrRPzgl9fzYtWJ3oDbzYZF ZobsYAnR8e
1ta5I8mwa33OvRz/nVJZ63Jw
=L4eZ
-----END PGP SIGNATURE-----


Thanks Mark, that's worked a treat and stopped me pulling my hair out
(again).
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003
Nov 12 '05 #3

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

Similar topics

2
by: Mal | last post by:
Greetings. I have a perplexing problem....please help. I am having a problem with an insert query. (SQL below) When I run the query via code (executing the SQL string) it crashes Access and...
0
by: Gary Carson | last post by:
Can anyone tell why the query below would throw a divide-by-zero error? The only reason I can see for the error happening would be if SUM() came out to be zero, but this never happens with the...
4
by: J. Jespersen | last post by:
Hi all, Have been using SqlDataSources for a while now. Reinstalled machine last week, now running Server 2003. Installed both SqlServer 2000 and 2005 with instance-names "sql2000" and...
7
by: Kevin | last post by:
Hi, With this, i get the error: " Microsoft VBScript runtime error '800a01ca' Variable uses an Automation type not supported in VBScript " at line 79 <% totintot=request.cookies("totintot")...
1
by: suslikovich | last post by:
Hi all, I am getting this error when insert values from one table to another in the first table the values are varchar (10). In the second they are datetime. The format of the data is mm/dd/yyyy...
9
by: VancouverMike | last post by:
Hi there, I run into a very strange problem. I got the following url and am passing information via query string. The problem when the "sin" key in query string is blank, shown as in the...
7
by: Comagmbh | last post by:
Hello! I am new to this group and I hope anyone can help me. I have an error message which is very complicated to me. Okay this message is very simpel, but I don`t understand how to build my SQL...
3
by: anupamadatta | last post by:
Hi there, I am trying to execute one Insert query using Pro C . the Insert query is as below: Prepared statement is : stmnt.len = sprintf((char*)stmnt.arr, "INSERT INTO %s ("...
9
by: sara | last post by:
Hi - I have code (below) that ran as recently as Monday. We decided to change the location for the output reports, and now the code errors (13 Type Mismatch) on the query. The query runs fine...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.