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

mail merge select record

P: n/a
Hi - I'm relatively new to VBA. I have a form that pops up for the
user. It asks for a docket #(which is alphanumeric). When the user
clicks the get record command button, it gets several fields for that
record and merges into the main document. My Select query only works
if the text is numeric. If it is alpha/numeric or alpha, it won't work
using the code. When I run the sub/userform it gives me the error
message: "Word could not parse your query options into a valid SQL
string."

My Select is:
"SELECT * FROM C:\PathFileNameOfMyDocument.doc WHERE ((Appeal = " &
txtAppeal.Text & "))"
I've also tried txtAppeal.Value with the same result.

Any help would be appreciated.

Thanks,
Paula

Dec 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Need quote. Change the query to

SELECT * FROM C:\PathFileNameOfMyDocument.doc WHERE ((Appeal = ' " &
txtAppeal.Text & " ' ))"
Hope this helps.

<He**********@michigan.govwrote in message
news:11**********************@i12g2000cwa.googlegr oups.com...
Hi - I'm relatively new to VBA. I have a form that pops up for the
user. It asks for a docket #(which is alphanumeric). When the user
clicks the get record command button, it gets several fields for that
record and merges into the main document. My Select query only works
if the text is numeric. If it is alpha/numeric or alpha, it won't work
using the code. When I run the sub/userform it gives me the error
message: "Word could not parse your query options into a valid SQL
string."

My Select is:
"SELECT * FROM C:\PathFileNameOfMyDocument.doc WHERE ((Appeal = " &
txtAppeal.Text & "))"
I've also tried txtAppeal.Value with the same result.

Any help would be appreciated.

Thanks,
Paula

Dec 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.