T
Tony Williams
I have a popup form that asks for criteria before opening another form. My
code is
Private Sub cmdFindDocs_Click()
On Error GoTo Err_cmdFindDocs_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMeetingPapers1"
If IsNull(Me.mtgcommtxt) Then MsgBox "Please enter Group Code"
Me.mtgcommtxt.SetFocus
Cancel = True
If IsNull(Me.MtgDatetxt) Then MsgBox "Please enter Meeting Date"
Me.mtgcommtxt.SetFocus
Cancel = True
If Not IsNull(MtgDatetxt) And Not IsNull(mtgcommtxt) Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_cmdFindDocs_Click:
Exit Sub
Err_cmdFindDocs_Click:
MsgBox Err.Description
Resume Exit_cmdFindDocs_Click
End Sub
However when the other form opens I want the popup to close automatically. I
added DoCmd.Close at the end of the code but this didn't work. Can anyone
help?
Tony
code is
Private Sub cmdFindDocs_Click()
On Error GoTo Err_cmdFindDocs_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMeetingPapers1"
If IsNull(Me.mtgcommtxt) Then MsgBox "Please enter Group Code"
Me.mtgcommtxt.SetFocus
Cancel = True
If IsNull(Me.MtgDatetxt) Then MsgBox "Please enter Meeting Date"
Me.mtgcommtxt.SetFocus
Cancel = True
If Not IsNull(MtgDatetxt) And Not IsNull(mtgcommtxt) Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_cmdFindDocs_Click:
Exit Sub
Err_cmdFindDocs_Click:
MsgBox Err.Description
Resume Exit_cmdFindDocs_Click
End Sub
However when the other form opens I want the popup to close automatically. I
added DoCmd.Close at the end of the code but this didn't work. Can anyone
help?
Tony