Results 1 to 4 of 4
  1. #1
    Kabethy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    7

    Unhappy Print Report function working in adp format but is not working in ade

    Hi Everyone,



    I am new in access, maybe this has a very simple answer. I had to migrate this function previously in access 2000 to access 2010 while working with adp's all works fine but when I convert my adp's into adp's the very simple steps shown below dont work anymore and I get the error


    Error #28557

    * The expression may not result in the name of a macro,
    the name of a user-defined function, or [Event Procedure].
    * There may have
    been an error evaluating the function, event, or macro.


    Private Sub cmdPrint_Click()
    Dim strDryCleaningParameters As String
    DoCmd.Echo False

    strDryCleaningParameters = gobjTicket.gstrLaundryNumber

    SetDryCleaningReportParameters "rptWwLaundryDryCleaningPrintTickets", strDryCleaningParameters
    DoCmd.OpenReport "rptWwLaundryDryCleaningPrintItemTickets", 2

    DoCmd.PrintOut

    DoCmd.Close acReport, "rptWwLaundryDryCleaningPrintItemTickets", acSaveYes

    ' Set echo as it was
    DoCmd.Echo True
    End Sub

    What am I getting wrong? I tried also without Print out and although no error is triggered no print is coming out =( when pressing the button I receive a quick screen saying printing but then nothing is printed. Any idea?

    Private Sub cmdPrint_Click()
    Dim strDryCleaningParameters As String

    strDryCleaningParameters = gobjTicket.gstrLaundryNumber

    SetDryCleaningReportParameters "rptWwLaundryDryCleaningPrintTickets", strDryCleaningParameters
    DoCmd.OpenReport "rptWwLaundryDryCleaningPrintItemTickets", acViewNormal

    End Sub

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Where is it breaking?

    Put in a bunch of debug.print statements i.e.:

    debug.print "Set srtDryCleaningParameters" after that variable is set
    debug.print "Opened report" after the first report is opened

    You can also put in some error trapping

    ON ERROR GOTO ErrorHandler

    <Your code here>

    exit sub

    ErrorHandler:
    Debug.print err.number & " " & err.description

    end sub

    and see what that tells you.

  3. #3
    Kabethy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    7
    Hi Guysthanks for your tips I found the problem basically I forgot to migrate the stored procedure that my report was calling. but nice tips to debug.

    Quote Originally Posted by Kabethy View Post
    Hi Everyone,

    I am new in access, maybe this has a very simple answer. I had to migrate this function previously in access 2000 to access 2010 while working with adp's all works fine but when I convert my adp's into adp's the very simple steps shown below dont work anymore and I get the error


    Error #28557

    * The expression may not result in the name of a macro,
    the name of a user-defined function, or [Event Procedure].
    * There may have
    been an error evaluating the function, event, or macro.


    Private Sub cmdPrint_Click()
    Dim strDryCleaningParameters As String
    DoCmd.Echo False

    strDryCleaningParameters = gobjTicket.gstrLaundryNumber

    SetDryCleaningReportParameters "rptWwLaundryDryCleaningPrintTickets", strDryCleaningParameters
    DoCmd.OpenReport "rptWwLaundryDryCleaningPrintItemTickets", 2

    DoCmd.PrintOut

    DoCmd.Close acReport, "rptWwLaundryDryCleaningPrintItemTickets", acSaveYes

    ' Set echo as it was
    DoCmd.Echo True
    End Sub

    What am I getting wrong? I tried also without Print out and although no error is triggered no print is coming out =( when pressing the button I receive a quick screen saying printing but then nothing is printed. Any idea?

    Private Sub cmdPrint_Click()
    Dim strDryCleaningParameters As String

    strDryCleaningParameters = gobjTicket.gstrLaundryNumber

    SetDryCleaningReportParameters "rptWwLaundryDryCleaningPrintTickets", strDryCleaningParameters
    DoCmd.OpenReport "rptWwLaundryDryCleaningPrintItemTickets", acViewNormal

    End Sub

  4. #4
    vscntkX is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2013
    Posts
    1
    Cung nhau tang toc nhung ngay cuoi nam.
    Co gang len anh em trong dien dan.
    Chuc mua xuan hanh phuc.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Nz function not working
    By Beerman in forum Queries
    Replies: 4
    Last Post: 10-24-2012, 11:46 AM
  2. Print button no longer working
    By kris335 in forum Programming
    Replies: 6
    Last Post: 09-28-2012, 08:56 PM
  3. Replies: 5
    Last Post: 10-26-2011, 02:59 PM
  4. Replies: 1
    Last Post: 02-18-2010, 01:02 PM
  5. Excel number format not working in Access
    By toad848 in forum Access
    Replies: 3
    Last Post: 03-24-2009, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums