Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating a crosstab query 2

Status
Not open for further replies.

sinbadly

Technical User
Mar 16, 2006
126
GB
The factory has about 30 different jobs, and a crosstab query shows the race of the people who work in these jobs. The number of official race divisions used is (a surprising) 17.

Is there a way to have the results of the crosstab appear in a Word document?

Another part of the database does give a report in Word, and that works well. But with 30 jobs titles and 17 racial divisions, I can't envisage how all these results could be sent to Word. Presumably there is a way?
 
Do you just want to export a grid to word? It sounds like you want to do something more sophisticated.

If you want to map certain fields in your query to certain parts of the report, it will be difficult to say the least, because the number of fields in a cross tab query changes each time. How handy are you with VBA?

Ignorance of certain subjects is a great part of wisdom
 
Thanks, AlexCuse

Yes, well, I thought it would be difficult. I want to make the report look good and reports as Access reports often don't. (Well, they can be made much more attractive in Word, anyway.)

What about Excel? Is it exportable to Excel, do you think.

I know my way around simple VBA, but I don't suppose I'd be up to a complicated job.
 
You can export to excel or copy and paste into excel. Or you might try using a pivottable report in excel for more formatting ability.
 
Export to excel would work, and you could use VBA to do some simple formatting on it once it's in there.

Here's a hint- You can start Excel's macro recorder, and do all the formatting you want. Then stop the recorder and view the code. This same code can be slightly modified for use with Access' Excel Automation features. Then you could set up a VBA event that exports, then goes into your spreadsheet and formates it for you.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Thanks very much, simon551, all noted.

Thanks very much, Alex. This sounds very encouraging, I must say. I'll work on it, and perhaps report back.

Very grateful, gentlemen. paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top