Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45

    Report from current record


    I am having trouble print previewing the current record from my form that is showing. I tried the command button, but it only shows the first record. Could someone please help?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    How about this:

    BaldyWeb wherecondition
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    How do you enter this code correctly? I am new to this.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    This is where you enter the code:

    http://www.baldyweb.com/FirstVBA.htm

    In answer to your PM, if you still need help you should be able to attach the db here, after doing a compact/repair and zipping.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    I am still having trouble and would like to send the file. I have compacted and repaired. How do you send as zip and where do you attach the file?

    Thank you,
    billgyrotech

  6. #6
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45

    Command button to print preview current record

    pbaldy,

    I have attached the zip file. When opening the database it opens Workorders by Customer. On the form there is a button (AFR) for what I want to do: preview the report with the current record. What happens now is it only previews the first record (Workorders). If I select a different Workorder on the subform the report shows only the first Workorder. I hope you can help.

    Thanks,
    billgyrotech
    Last edited by billgyrotech; 07-26-2011 at 01:07 PM. Reason: additional details

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Which button?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    I am sorry about that. It is the AFR button.

    Thanks

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    That button doesn't incorporate the code in my link. You have other button code that uses that technique, though the buttons don't appear to exist anymore. Did you try incorporating that technique into this button?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    Yes I tried but to no avail. It still only shows the first Workorder.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    What did you try, so we can fix it? The other efforts appeared correct but looked to be using the name of the form instead of the name of the field in the report.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    This is why I need help. I am not sure how to fix this command button to yield the current or chosen workorder number for the report.

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    You said you tried, I was hoping to see the effort and fix it. Try

    DoCmd.OpenReport "ReportName", acViewPreview, , "CustomerID = " & Me.CustomerID

    presuming that's the field you want filtered on.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    It is filtered on WorkorderID so I put that in. The code seems to work and asks for the Workorder number to be entered. If the disposition field is blank then the report is blank. Can this be fixed to generate the work order while it is being repaired?

  15. #15
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    It shouldn't ask, it should get it from the form. What exactly is your code, and where is it supposed to get the workorder. That appears to be on the subform.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Email a report of the current record.
    By jonudden in forum Reports
    Replies: 4
    Last Post: 08-21-2023, 07:37 AM
  2. Show only current record in report from form/subform
    By stelioshania in forum Reports
    Replies: 0
    Last Post: 03-02-2011, 02:19 PM
  3. copy current record to new record
    By er_manojbisht in forum Forms
    Replies: 1
    Last Post: 02-27-2010, 05:31 PM
  4. Replies: 3
    Last Post: 02-13-2008, 09:55 AM
  5. Mailmerge Current Record...
    By oakleyp2 in forum Programming
    Replies: 0
    Last Post: 02-22-2006, 08:08 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