Run-time error '2059' (1 Viewer)

Arcadia

Registered User.
Local time
Yesterday, 21:27
Joined
Jan 25, 2013
Messages
66
Hello, i have a question and hope someone can help me out here :rolleyes:

In Access i have this VBA code to export a PDF file:

Private Sub Command17_Click()

DoCmd.OutputTo acOutputForm, "TrainingCalenderForm", acFormatPDF, "C:\Users\User\Documents\Trainingmap\Training.pdf"

End Sub

But when i click the button i keep getting this error:

Run-time error '2059':

Microsoft Access cannot find the object '|1'.


My head is starting to hurt can someone see what i'm doing wrong :banghead:
 

pr2-eugin

Super Moderator
Local time
Today, 05:27
Joined
Nov 30, 2011
Messages
8,494
Does the TrainingCalanderForm based on a Query that requires a parameter??
 

Arcadia

Registered User.
Local time
Yesterday, 21:27
Joined
Jan 25, 2013
Messages
66
Yeah the form is based on a query..
 

pr2-eugin

Super Moderator
Local time
Today, 05:27
Joined
Nov 30, 2011
Messages
8,494
So what has happened to the second part of my question?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 23:27
Joined
Feb 28, 2001
Messages
27,140
That particular error almost always means that some error has occurred in the form or report you were trying to output based on having named something in the form's RECORDSOURCE query or on a control's ROWSOURCE query, when you spelled the object wrong or named an object that didn't appear in the referenced query's underlying recordset.

I.e. the query processor failed to find an element in something that implies use of a query.
 

JHB

Have been here a while
Local time
Today, 06:27
Joined
Jun 17, 2012
Messages
7,732
To a start, show the SQL-string for the query the form is based on.
Else post a stripped version of your database with some sample data, (zip it) + info in which form you have the button.
 

Users who are viewing this thread

Top Bottom