By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,460 Members | 2,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,460 IT Pros & Developers. It's quick & easy.

A2K - error for this query is very strange!

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
-----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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.