Forgot password? | Forgot username? | Register

Word and Excel Reports and VB Code

Word and Excel Reports and VB Code

Has anyone set up reports using Word and Excel using the VB code mentioned in the Help section?

When setting up my Word report I keep getting a runtime error 5922 and the is highlighted in yellow:

.OpenDataSource _
Name:="", _
Connection:="DSN=EMu Catalog;", _
SQLStatement:="SELECT * FROM ecatalog.csv", _
Subtype:=wdMergeSubTypeWord2000

The last line has an arrow next to it.

Any suggestions?

I also noticed in the help section for the Excel reports they just copied the code for Word with a few modifications at the beginning. Will this work?

If some could share their code I would be most grateful!

Edited by: - 01-Jan-70 09:00:00

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Word and Excel Reports and VB Code

Hello Paula,

The VB code you have looks correct. I suspect that the DSN name is incorrect. The Data Source Name for the catalogue module is "EMu Catalogue", so I would suggest changing:

Connection:="DSN=EMu Catalog;", _

to

Connection:="DSN=EMu Catalogue;", _

Regards

bern.
Bernard Marshall
KE Software
Melbourne, Australia

Bernard Marshall (Axiell Melbourne)
useravatar
Offline
43 Posts
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Word and Excel Reports and VB Code

Hi Bernard-

Thanks for your reply.

I tried your suggestion without any luck.

The KE help section on Word reports has a section on DSN tables. The DSN listed for catalogue is EMu Catalog- this must be a typo.

Is there anything else I am missing?

Is there some revised code available that I could use.

Thanks again-

Paula

Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic

Board Info

Board Stats
 
Total Topics:
599
Total Polls:
0
Total Posts:
1362
Posts this week:
4
User Info
 
Total Users:
812
Newest User:
Vilasack
Members Online:
3
Guests Online:
238