none
Report opens behind form that called it RRS feed

  • Question

  • Hi all,

    Using Acc2010 - I have a form that opens a form that opens a form with inquiry options. When I click one of the cmd button options it opens a report with the data, but the report is behind the forms and I either have to move the forms or close them in order to view the report. How do I get the report to open in the foreground and leave the forms open when I close it so I can make another choice on the inquiry form.  Is there a property to set or is it done in VB? I don't think I've ever had this trouble b/4 - somehow I think I must have changed a default option or something.   Thanx, Gil

       
    Sunday, June 12, 2016 1:34 AM

Answers

  • Hi The Gilbernator

    It' a little bit strange because the  opening and closing object methods haven't the same syntax

    • To close
      docmd.close  ObjectType(acForm, acReport...) , objectName (string value), saveType -> for more information here
    • To open there is a dedicated command for each object
      Docmd.openform [parameters]
      Docmd.openreport [parameters]...

    For more information about DoCmd methods go here and look for all methods beginning with open and close



    Sunday, June 12, 2016 3:14 PM
  • >>>Is there a property to set or is it done in VB?

    According to your description, you could you can do it explicitly with DoCmd.SelectObject:
    DoCmd.OpenReport "rptMyReport", acViewPreview
    DoCmd.SelectObject acReport, "rptMyReport"
    DoCmd.Close acForm, Me.Name
    If that doesn't work, there's something else involved, like forms or reports opened with the acDialog switch, or with forms/reports having the Modal or Popup properties set to True.
    Monday, June 13, 2016 3:30 AM

All replies

  • Hi The Gilbernator

    "when I close it ", What is "it" please ?

    And go here for explanation about using this  API

    Public Declare Function BringWindowToTop Lib "user32" (ByVal hWnd As Long) As Long

    Ta care you need to consider  windows environment 32 or 64 bits . About this problem, go here






    • Edited by technet65 Sunday, June 12, 2016 8:33 AM
    Sunday, June 12, 2016 8:14 AM
  • The 'it' is the report, from the beginning of the sentence.

    Thanks for the answer - I just thought, is there a 'docmd' equivalent to your API?

    I'll look thru the docmd's and see if I can find one

    Sunday, June 12, 2016 11:33 AM
  • Hi The Gilbernator

    It' a little bit strange because the  opening and closing object methods haven't the same syntax

    • To close
      docmd.close  ObjectType(acForm, acReport...) , objectName (string value), saveType -> for more information here
    • To open there is a dedicated command for each object
      Docmd.openform [parameters]
      Docmd.openreport [parameters]...

    For more information about DoCmd methods go here and look for all methods beginning with open and close



    Sunday, June 12, 2016 3:14 PM
  • >>>Is there a property to set or is it done in VB?

    According to your description, you could you can do it explicitly with DoCmd.SelectObject:
    DoCmd.OpenReport "rptMyReport", acViewPreview
    DoCmd.SelectObject acReport, "rptMyReport"
    DoCmd.Close acForm, Me.Name
    If that doesn't work, there's something else involved, like forms or reports opened with the acDialog switch, or with forms/reports having the Modal or Popup properties set to True.
    Monday, June 13, 2016 3:30 AM