Results 1 to 6 of 6
  1. #1
    kroenc17 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Location
    Albany, NY
    Posts
    49

    report opens.. but not to front

    Hello all.. I've been working on a database that has a Form open ... "Home" .. at all times. Can't be closed. So far all the other forms and reports I've made have opened in a new tab at the top of the screen and when I open them they are sent to the front or they are put on top of the "Home" form ... for some reason I now have ONE report that opens itself in a new tab as they all do, but it puts itself behind the "Home" form, and I have to click on it's tab to bring it to the front.

    How do I change this?

    Edit: I should also note that a form is used to generate the report in question. An employee is selected and then a command button with an embedded macro is clicked. The Macro is:
    OpenReport
    Close

    The first line opens the report, the second line closes the form.

    Thanks

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    put this after the code which open the report:

    reports("report name").setfocus

  3. #3
    kroenc17 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Location
    Albany, NY
    Posts
    49
    If I remove the Close line from the macro, the Report opens on top of the "Home" form as I want it to, but the mediator form still remains open, as such: (see 1.jpg attached)

  4. #4
    kroenc17 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Location
    Albany, NY
    Posts
    49
    weekend: added this line to the bottom of my macro

    Action: RunCode
    Arguments: reports("Workload").setfocus

    I get this error: Access can not find the field 'setfocus' referred to in your expression.

  5. #5
    kroenc17 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Location
    Albany, NY
    Posts
    49
    solved it myself in VB:
    Set the command button to event procedure.. heres my code

    Private Sub Command1_Click()
    Me.Visible = False
    DoCmd.OpenReport "Workload", acViewReport
    DoCmd.Close acForm, "Staff Search"
    End Sub
    I had tried the event procedure approach but was using acViewNormal instead of Report and that was trying to print my report every time lol

  6. #6
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I am glad that you figured it out

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

Similar Threads

  1. Clicking on label opens up new record
    By swimmermx in forum Forms
    Replies: 2
    Last Post: 07-20-2010, 03:58 PM
  2. Auto increment when the form opens
    By Lynn in forum Forms
    Replies: 13
    Last Post: 04-11-2010, 12:49 PM
  3. Replies: 1
    Last Post: 11-10-2009, 03:03 PM
  4. Shortcut that ONLY opens Access Form
    By uneek78 in forum Forms
    Replies: 0
    Last Post: 03-30-2009, 06:52 AM
  5. Access opens Frontpage
    By windsurfer in forum Access
    Replies: 0
    Last Post: 02-10-2008, 03:53 PM

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