Exporting Reports with subreports to excel (1 Viewer)

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
Ok I pasted the code in the form module (not sure if I did that right).... I made the command button and pasted in the code then click on to test and It stopped when it got to this line in the code

DoCmd.DeleteObject acQuery, “qryWestportExport"
 

GinaWhipp

AWF VIP
Local time
Yesterday, 22:53
Joined
Jun 21, 2011
Messages
5,899
Try retyping the quotes as I see a *smart* quotation mark in there.
 

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
ok I did that and it worked now I have this error.

Here is the error message

RUN TIME ERROR 3012

OBJECT qryWestportExport already exist

then i debug and this is where it goes.

Set qryDef = dbs.CreateQueryDef("qryWestportExport", strSQL)


thank u
 

GinaWhipp

AWF VIP
Local time
Yesterday, 22:53
Joined
Jun 21, 2011
Messages
5,899
Oops, didn't delete on last run... I'll write code for that later... in the meantime go look in the Navigation Pane and delete the query qryWestportExport.
 

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
ok did that n it stops at this line

‘Set xlWSh = xlWBk.Worksheets(strSheetName)
 

GinaWhipp

AWF VIP
Local time
Yesterday, 22:53
Joined
Jun 21, 2011
Messages
5,899
Typo...

Replace that section with...

Code:
             Set xlWSh = xlWBk.Worksheets(strSheetName)
            xlWSh.Range("I1").Value = Me.ID
            xlWSh.Range("I2").Value = Me.[COVER PART NUMBER]
            xlWSh.Range("I3").Value = Me.[DESCRIPTION]
 

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
This is where it stopped after i made the change.

xlWSh.Range("I1").Value = Me.ID

It highlighted on Me.

EDIT: IT SAYS INVALID USE OF Me KEYWORD

EDIT: I think I figured it out I just changed the Me to the Form name and it work now it stops at this.



xlWBk.SaveAs "N:\EXACT FIT\WESTLAND EXPORT PLUS\Westland_" Format(Date, "mm.dd.yyyy") & ".xlsx, 51

Edit: I am gonna wait on you I dont want to mess this up. LOL
 
Last edited:

GinaWhipp

AWF VIP
Local time
Yesterday, 22:53
Joined
Jun 21, 2011
Messages
5,899
Hmm, I always use Me. so that is strange but no mind you got it working. Now, what's with the last line... you want to save it differently?
 

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
Well im not sure if i got it working.
it doesnt say the parh is wrong it hilights on the word format. Tjen i played around with it n took some quotes out. It ran thru the code but no qry was produced so no data was sent to the template n saved to the bew one. So im thinking changing the Me to the form name didnt work. So not sure what to do.

Thanks
 

GinaWhipp

AWF VIP
Local time
Yesterday, 22:53
Joined
Jun 21, 2011
Messages
5,899
The database... That way I could adjust *on the fly*, just looking to save a little time.
 

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
ok I have linked tables but I will change that so I can send it..
thank you so much
 

GinaWhipp

AWF VIP
Local time
Yesterday, 22:53
Joined
Jun 21, 2011
Messages
5,899
Oh... it's split (that's great) but for me I will need a complete file. Then you could just copy/paste the code behind you Front end Form. Sorry for making work for you. :(
 

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
i tried to upload it and it would let me said that a security token was missing????

edit: i dont mind extra work at all as long as we get this to work i will be sooooooo happy.
 
Last edited:

Snappy1263

Registered User.
Local time
Yesterday, 22:53
Joined
Dec 8, 2015
Messages
130
Just over 3 mb

ILL TRY AGAIN

EDIT: OK IT LOOKED LIKE IT WORKED THIS TIME...I SAW IT SAY UPLOADING.
 
Last edited:

GinaWhipp

AWF VIP
Local time
Yesterday, 22:53
Joined
Jun 21, 2011
Messages
5,899
I am not getting a file... Okay, let's try this...

gina at access-diva dot com

Trying to keep SPAM down to a minimum.
 

Users who are viewing this thread

Top Bottom