• ** There has been a recent site upgrade. Please clear your browser cache to avoid issues. **
  • New forum feature - post voting and best solution

    Check out this thread for the details: https://www.access-programmers.co.uk/forums/threads/new-forum-feature-post-voting-and-best-answer.314134/

    This new feature looks great to me! :)

  • We now have 3 forum themes

    Go for the default (light) theme, Shades of Grey or Shades of Blue. I just added the Blue one.

    The thread about it is here: https://www.access-programmers.co.uk/forums/threads/new-forum-theme-shades-of-blue.314136/

Run-time error '2059' (1 Viewer)

Arcadia

Registered User.
Local time
Today, 05:52
Joined
Jan 25, 2013
Messages
75
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, 12:52
Joined
Nov 30, 2011
Messages
8,498
Does the TrainingCalanderForm based on a Query that requires a parameter??
 

Arcadia

Registered User.
Local time
Today, 05:52
Joined
Jan 25, 2013
Messages
75
Yeah the form is based on a query..
 

pr2-eugin

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

The_Doc_Man

Immoderate Moderator, Former MVP, Retired SysAdmin
Staff member
Local time
Today, 07:52
Joined
Feb 28, 2001
Messages
18,012
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, 13:52
Joined
Jun 17, 2012
Messages
7,720
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