Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The following should open the report to a single record that equals the field named SITE NUMBER, provided the field exists in the reports RecordSource. I left off acWindowNormal in case that was conflicting with your DB settings.



    DoCmd.OpenReport "Front", acViewPreview, , "[SITE NUMBER] = " & Me![SITE NUMBER]

  2. #17
    keiath is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    162
    Hi

    Yeah that kinda works you have to input the site code but that's fine, at least now it only opens the report I want

    Thanks for your help in this matter

  3. #18
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The code works. What kinda works is your report. The report's recordsource needs to be capable of managing the criteria you send to it.

  4. #19
    keiath is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    162
    Like i said it does work, I get a dialog box, I type in the Site code and it brings up the correct page

  5. #20
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I can not know for certain but I have my suspissions.

    You get a prompt similar to the one in this screenshot?
    https://www.accessforums.net/queries...tml#post220366

  6. #21
    keiath is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    162
    Yes I am

    Thank you

  7. #22
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I made a fundamental error in the code I provided to you in post #16. I edited and it is correct now. Should be
    DoCmd.OpenReport "Front", acViewPreview, , "[SITE NUMBER] = " & Me![SITE NUMBER]

    Having Said that, the previous code should have worked. As long as your report can filter on SITE NUMBER the above code should work.

  8. #23
    keiath is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    162
    Yep after sorting out the report ALL works fine

    Thanks

  9. #24
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Glad you have it working and sorry for not taking the time necessary to verify the code I provided to you in post#16.

  10. #25
    keiath is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    162
    This is solved

    Thanks

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

Similar Threads

  1. Printing report from Form
    By cotri in forum Access
    Replies: 8
    Last Post: 05-24-2013, 12:01 PM
  2. Replies: 8
    Last Post: 04-29-2013, 11:23 AM
  3. Printing a report in a navigation form
    By DanKoz in forum Forms
    Replies: 2
    Last Post: 08-29-2011, 12:11 PM
  4. Printing a single report from form
    By OFA in forum Forms
    Replies: 9
    Last Post: 06-08-2010, 09:27 AM
  5. Replies: 16
    Last Post: 06-03-2009, 07:01 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