Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23

    Error in Print Report Button

    I need to be able to select certain names to be able to email their reports to a single end user. What I have done so far is add a y/n field in the names table, created a form that list all the names along with the y/n field (Named PrntRpt) and inserted a select switch to email the selected names with their records to the end user.
    The program I have created is



    Dim stDocName As String
    Dim intLet As Integer
    stDocName = "CPEReport"
    intLet = -1
    docmd.OpenReport stDocName, acPreview, , "PrntRpt = '" & Me.intLet & "'"

    The problem I have is .inLet is not recognized by the computer and giving me a "Compile Error: Method or Data Member Not Found"

    What am I doing Wrong?

    Thank you for your help

    Robert M

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try:
    docmd.OpenReport stDocName, acPreview, , "PrntRpt = -1"

  3. #3
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    Once again you have come through with the proper syntax to do the job... How much for lessons?

    Robert M

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    All of the coins you find in your sock drawer. You're welcome.

  5. #5
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    Ok, I Speaketh too soon, making me be a Jah Kas, When I entered...

    Private Sub cmdPrntRpt_Click()
    On Error GoTo Err_cmdPrntRpt_Click
    Dim stDocName As String
    stDocName = "CPEReport"
    docmd.OpenReport stDocName, acPreview, , "PrntRpt = -1"

    I get a "Enter Parameter Value PrntRpt"

    Trying it with a "-1" I get ALL records to print, with a "0" I get no records available

    I would give you all the coins in my sock drawer, but it would cost more to send the 30 pounds of coins than the coins are worth.

    "Sorry about that Chief"

    Thanks for your patience and help

    Robert M

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does the Report RecordSource have a field named "PrntRpt"? It will not work if it doesn't.

  7. #7
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    Yes, I have "PrntRpt" as a field in the Table that I have the form being built from. I have the form split into Form Header and Detail, The Print Button is in the Form Header while the "PrntRpt" field is in the Detail, detail of the form is set for continous so as you can go down the rows and check the one(s) you want to print.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Reports are not interactive. They are basically a piece of paper. They also do not have a continuous mode. What are you talking about?

  9. #9
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    My appologies RuralGuy, I am self taught in this and therefore do not have the benefit of calling a pot a pot. What I have is a Form that has the information from my table that has the name of the person whose data I am wanting to print along with the Y/N print field. From this I am able to set the criteria needed to pull the information from the records to place in the report that I am wanting. I have since solved this problem By placing the PrntRpt Y/N field into the query that my report information is drawn from. Now I am able to print what I am wanting.

    HOWEVER!

    There is a glitch in that once I generate a report, and then choose different records to print a different Report. I get a one of the past records sticks around to show up in my other report. Is there a way to set the Y/N field to "0" so as to have a clean selection field to work with?

    Thank you for your patience and time
    The ID 10 + may be awarded to me for not having ALL the fields needed in the report. when we get everything working as desired.

    Robert M

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm afraid I do not really understand what you have done. What was wrong with just putting a filter on your report like you were doing?

  11. #11
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    Nothing really wrong with putting a filter in, just that the end user is wanting to select certain individuals to print their reports or email them to their higher ups. I have gotten all that working well without too much trouble. And the end user is very pleased with it. However, (always a however ain't thar) in clicking the print y/n field for the individuals I have to have then end user press enter before clicking on the print or email button. This is so the last y/n field that was clicked is accepted by the computer. Also, there is the problem of resetting the y/n field to "0" once the job is done.
    I do thank you for all your help with this project. With Luck we might even be able to sell this to other users to help them with their projects.
    If you have any thoughts on the Enter to get the last y/n field clicked problem as well as the reset to all "0" or false that would be helpful.

    Thank you again for your help

    Robert M

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You may need to post your db so we can look at it. I'm not sure what you have or what you've done. Compact and Repair first and then zip it up. Of course remove any sensitive data.

  13. #13
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23
    I have gotten the program set to show only the problem I am having with the "Select Group to Print" the file size is 532KB I am unable to zip it so I can not attach it to this E-Mail. My appologies for adding muddy waters to the muddy water of this muddy problem. I would attach the program in its edited form but I don't see where to attach the file to this.
    To restate the problem. In selecting the individuals I have to press enter so that the last selection is accepted by the computer. Is there a way to insert into the print button program (see below) to accept the last checked individual so that all selected individuals. Then after the print job is done to clear all selected individuals.

    Private Sub cmdPrntRpt_Click()
    On Error GoTo Err_cmdPrntRpt_Click

    Dim stDocName As String
    Dim PrntRpt As Boolean

    (possible line to cause all checked individuals to be acccepted by the computer)

    If Check19 = -1 Then
    stDocName = "CPEReport-Forecasts"
    docmd.OpenReport stDocName, acPreview, , "PrntRpt = -1"
    Else
    stDocName = "CPEReport"
    docmd.OpenReport stDocName, acPreview, , "PrntRpt = -1"
    End If

    (at this point I believe that all checked individuals can be reset to "0")

    Exit_cmdPrntRpt_Click:
    Exit Sub
    Err_cmdPrntRpt_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrntRpt_Click

    End Sub

    Thank you again for all your help and patience

    Robert M

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    A right click of the file and "Send to" Compressed file should zip it. If you use the Post Reply button and scroll down, you will see a Manage Attachments button.

  15. #15
    Robert M is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    23

    CPE TestDatabase attached

    Thanks for the heads up RG Here is the Database

    I have placed 6 individuals (A,B,C) in the "Attendees" Table To give you an idea of how the program works. Since some of my co-workers want to know if they take more programs what their total hours would be. Thus I have a y/n field called "Forecast" The "Forecast" field is to include those records that do have Forecast with those that do not have the forecast so that the individual may check the total time earned in his CPE

    Now the question I have from the previous E-Mail Correspondence is, "Is it possible to program the Print Button to cause the last y/n field to be accepted by the computer. And, once everything is done to replace or reset the y/n fields to a value of '0' "

    I can not thank you enough for the help you have given me in this ^><^ project.

    Robert M

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Print Report from Form ID
    By Brian62 in forum Forms
    Replies: 1
    Last Post: 09-18-2009, 01:50 PM
  2. Error while trying to add delete link button.
    By islandboy in forum Access
    Replies: 3
    Last Post: 09-03-2009, 09:32 AM
  3. Error when trying to print or print preview
    By TriAdX in forum Reports
    Replies: 8
    Last Post: 08-25-2009, 08:20 AM
  4. Find Record button error
    By Zedlexx in forum Forms
    Replies: 0
    Last Post: 03-11-2009, 09:26 AM
  5. add a print button
    By gromit95 in forum Forms
    Replies: 0
    Last Post: 08-13-2008, 07:28 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