Results 1 to 4 of 4
  1. #1
    lone_rider15 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    2

    VBA Code to Browse to Report

    Hi,



    I hope everyone is doing well!

    I have an Access Database Application. I have created a form to detect idle time. After the idle time expires I'd like the application to view "rptQcDashboard" in subform. In the application navigation button "NavBtnQcDashboard" has "rptQcDashboard" as the Navigation Target Name. I tried the below code but it does not work.
    Code:
    Sub IdleTimeDetected(ExpiredMinutes)
        DoCmd.BrowseTo acBrowseToReport, "rptQcDashboard", "frmMain.MainSub"
    End Sub
    My test database is attached.
    How can I achieve that?
    Attached Files Attached Files

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Cross posted a similar question at : https://www.access-programmers.co.uk...d.php?t=298788
    Follow forum guidelines regarding cross-posting
    Say you have done so AND provide a link

    So have you abandoned the previous outcome in the earlier post?

    Unclear what you are trying to do using BrowseTo
    If you just want to view the report after idle time has elapsed, just use

    Code:
    Sub IdleTimeDetected(ExpiredMinutes)
       DoCmd.OpenReport "rptQcDashboard", acViewPreview
    End Sub
    Last edited by isladogs; 03-16-2018 at 07:51 AM.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    lone_rider15 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    2
    Quote Originally Posted by ridders52 View Post

    Unclear what you are trying to do using BrowseTo
    If you just want to view the report after idle time has elapsed, just use

    Code:
    Sub IdleTimeDetected(ExpiredMinutes)
       DoCmd.OpenReport "rptQcDashboard", acViewPreview
    End Sub
    This will view the report in a separate tab. I just want to view the report in the sub form of the navigation form. I want the outcome of the below button clicks of the attached database.
    Regular QC> Dashboard

    Thanks again for your help.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    OK - I'm going to drop out of this thread... at both forums
    Its difficult to understand the point of what you are trying to do.
    Perhaps others can contribute if you explain the purpose of the whole thing.

    Please update the thread at AWF also
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 22
    Last Post: 07-16-2015, 11:23 AM
  2. Error in Open/Browse folder code in access 2010
    By stigmatized in forum Programming
    Replies: 4
    Last Post: 10-01-2014, 01:55 PM
  3. Report Code is not allowing return to main code
    By rcwiley in forum Programming
    Replies: 2
    Last Post: 06-16-2013, 10:31 AM
  4. Replies: 3
    Last Post: 02-22-2013, 06:41 AM
  5. Browse Option
    By emilylu3 in forum Access
    Replies: 1
    Last Post: 01-10-2006, 09:46 AM

Tags for this Thread

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