OpenForm command...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kurt Blom

    OpenForm command...

    Hi all,

    In my current project, I open other forms from within my 'Parentform'.
    In this parentform, dates of the selected forms are queried. Each time,
    the parentform (frmParentForm) is minimized (DoCmd.Minimize ) when a
    'subform' is openend. When the report for the specific date is
    completed, I close the subform by a close button:

    Private Sub btnClose_Click( )
    On Error GoTo Err_btnClose_Cl ick

    DoCmd.Close
    DoCmd.OpenForm "frmParentForm" , acNormal (**)

    Exit_btnClose_C lick:
    Exit Sub

    Err_btnClose_Cl ick:
    MsgBox Err.Description
    Resume Exit_btnClose_C lick

    End Sub

    When the parentform is shown again, the last report date is not yet
    displayed. How can I easily refresh the parentform after it is opened? (**)

    Thanks in advance,

    Kurt.
  • Paul

    #2
    Re: OpenForm command...

    Why not just set the controlsource (query) for the subform to have the date
    from the parentform as the criteria:
    in the query criteria enter:

    [forms]![parentformname]![datefieldname]

    or if you have 2 dates

    between [forms]![parentformname]![STARTdatefieldn ame] &
    [forms]![parentformname]![ENDdatefieldnam e]

    Then close or hide the parent form when the subform opens.

    HTH
    Paul

    "Kurt Blom" <Kurt.Blom@UGen t.be> wrote in message
    news:cmt8ah$rh7 $1@gaudi2.UGent .be...[color=blue]
    > Hi all,
    >
    > In my current project, I open other forms from within my 'Parentform'. In
    > this parentform, dates of the selected forms are queried. Each time, the
    > parentform (frmParentForm) is minimized (DoCmd.Minimize ) when a 'subform'
    > is openend. When the report for the specific date is completed, I close
    > the subform by a close button:
    >
    > Private Sub btnClose_Click( )
    > On Error GoTo Err_btnClose_Cl ick
    >
    > DoCmd.Close
    > DoCmd.OpenForm "frmParentForm" , acNormal (**)
    >
    > Exit_btnClose_C lick:
    > Exit Sub
    >
    > Err_btnClose_Cl ick:
    > MsgBox Err.Description
    > Resume Exit_btnClose_C lick
    >
    > End Sub
    >
    > When the parentform is shown again, the last report date is not yet
    > displayed. How can I easily refresh the parentform after it is opened?
    > (**)
    >
    > Thanks in advance,
    >
    > Kurt.[/color]


    Comment

    Working...