888 Word Merge String Criteria

A

Andy

Hi;

Using Albert Kallal's Word Merge code to merge 2 qrys, (Estimate &
Purchase). It works perfectly. Thank You Albert.

Need some help with using String Criteria.

Here is the process:
In either the Estimate or Purchase form; the user clicks a command button
that opens a second form that uses the specific qry as it's control source.
On that second form is a command button that triggers the code for the Word
merge.

What I need to learn is how to use a String Criteria to display only the
current record from the first form in the controls of the second form.

EG: If displaying Customer15 in the first form want to see only Customer15
displayed in the second form. Currently the second form displays all of the
records.

Have tried this and it doesn't work.
If Me.Dirty Then Me.Refresh
Dim strCriteria As String
strCriteria = "[PurchaseNo]='" & Forms!frmPurchase!txtPurchaseNo & "'"

DoCmd.OpenForm "frmWordMerge", , strCriteria

Is the above scenario the best answer or is there a better one that I
haven't discovered yet?

Does anyone have the answer to this question and would You be kind enough to
share it?

Thank You.
 
C

Cindy M -WordMVP-

Hi Andy,

Again, you want to address this question to an Access group. It has nothing to
do with Word's MailMerge feature, but with coding in the Access environment.
Using Albert Kallal's Word Merge code to merge 2 qrys, (Estimate &
Purchase). It works perfectly. Thank You Albert.

Need some help with using String Criteria.

Here is the process:
In either the Estimate or Purchase form; the user clicks a command button
that opens a second form that uses the specific qry as it's control source.
On that second form is a command button that triggers the code for the Word
merge.

What I need to learn is how to use a String Criteria to display only the
current record from the first form in the controls of the second form.

EG: If displaying Customer15 in the first form want to see only Customer15
displayed in the second form. Currently the second form displays all of the
records.

Have tried this and it doesn't work.
If Me.Dirty Then Me.Refresh
Dim strCriteria As String
strCriteria = "[PurchaseNo]='" & Forms!frmPurchase!txtPurchaseNo & "'"

DoCmd.OpenForm "frmWordMerge", , strCriteria

Is the above scenario the best answer or is there a better one that I
haven't discovered yet?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top