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

mail merge select record

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
1 2015
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve M | last post by:
I'm trying to do invoke the mail merge functionality of MS Word from a Python script. The situation is that I have a template Word document, and a record that I've generated in Python, and I want...
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
0
by: Linda Cacina | last post by:
Hello all you fine folks, Here is some code I am using to merge data from a single record Access 2K3 table into a NEW word document based on a pre-defined Word merge template doc. All I want to...
1
by: kirkus84 | last post by:
I am currently trying to do a multiple record mail merge through a query via a command button on a form. The query basically displays customers who have said yes to privacy. The user inputs a date...
1
by: kayberrie | last post by:
I want to write a VBA mail merge code. I want to link the code/macro/dohicky to a nifty little button so it makes life easy. I think I can handle the button part, the code part - not so much. I know...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.