Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

Union Query and Mail Merge sorting problem

I work with test procedures, inspection reports and work items.  The work items are of 2 different work types i.e. Type A and Type B

I have a union query that ties 3 different queries.

The test procedure is enter into selector form's text box and the command buttton opens the union query.

The union query gathers Type A (Query #1) and Type B (Query #2) work items assigned to the test procedure.  The third Query adds  a STATEMENT  that tells the inspector that all of Type A and B work types have been gatther and the report is ready for them to add their hand written decrepancies  to the report.  

Everything is working fine, but when press the "Publish It In Word" command button to get ready for the mail merge.  The STATEMENT does not always appear at the bottom of the Word table.

How do I fix the queries in order for the STATEMENT always appears at the bottom of the Word table?  .
0
Michael Janiszewski
Asked:
Michael Janiszewski
2 Solutions
 
tbsgadiCommented:
Can you post your queries Please

Gary
0
 
dannywarehamCommented:
This may not be an issue with the queries (although it probably is :-p  )

Exporting reports to Word (especially heavily formatted reports) doesn't always work well.
I find that rectangles and tables are most prone to alter in the export.
Try exporting as a snapshot and see if it retains the data in the correct places.

If you can post your queries (as gary suggests), and we'll have a look at those too.

Finally, if you are using subreports (for example, you have customer data on the main report and products on the subreport, as is normal) then Word does not support this.
Instead, you need to get every field for your merge into a single source record. then you can pass teh data to fields in the Word doc directly.

Alternatively, you have to use automation to loop through your records and pass seperate record data across to Word (and this is not easy)  :-)

Danny
0
 
Michael JaniszewskiRetired Access Database AdministratorAuthor Commented:
Sorry, I paniced before I did more testing and really looking at my query results.  They were in alphabetical order.  The Type A work items all started with a "R" and the Type B work items all started with a "T" and the STATEMENT started with a "E" causing it to be at the top of any query.

So my solution was to start the the STATEMENT with a "z" which it drove the STATEMENT to the bottom of the query.  
After doing the mail merge I corrected the misspelling.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now