A
Annelie
I used the below listed command button code to close one form and open
another. It works. Then I put the same code in reverse listed below, it
closes the first form but does not open the other one.
Can anyone see why the second one does not work?
Annelie
Private Sub CmdOpenEmplList_Click()
On Error GoTo Err_CmdOpenEmplList_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmEmployeeCurrentData"
DoCmd.Close acForm, "FrmEmployeeCurrentData"
stDocName = "FrmEmployeeList"
DoCmd.OpenForm "FrmEmployeeList", , , stLinkCriteria
Exit_CmdOpenEmplList_Click:
Exit Sub
Err_CmdOpenEmplList_Click:
MsgBox Err.Description
Resume Exit_CmdOpenEmplList_Click
End Sub
----------------------------
Private Sub CmdOpenEmplList_Click()
On Error GoTo Err_CmdOpenEmplList_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmEmployeeList"
DoCmd.Close acForm, "FrmEmployeeList"
stDocName = "FrmEmployeeCurrentData"
DoCmd.OpenForm "FrmEmployeeCurrentData", , , stLinkCriteria
Exit_CmdOpenEmplList_Click:
Exit Sub
Err_CmdOpenEmplList_Click:
MsgBox Err.Description
Resume Exit_CmdOpenEmplList_Click
End Sub
another. It works. Then I put the same code in reverse listed below, it
closes the first form but does not open the other one.
Can anyone see why the second one does not work?
Annelie
Private Sub CmdOpenEmplList_Click()
On Error GoTo Err_CmdOpenEmplList_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmEmployeeCurrentData"
DoCmd.Close acForm, "FrmEmployeeCurrentData"
stDocName = "FrmEmployeeList"
DoCmd.OpenForm "FrmEmployeeList", , , stLinkCriteria
Exit_CmdOpenEmplList_Click:
Exit Sub
Err_CmdOpenEmplList_Click:
MsgBox Err.Description
Resume Exit_CmdOpenEmplList_Click
End Sub
----------------------------
Private Sub CmdOpenEmplList_Click()
On Error GoTo Err_CmdOpenEmplList_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmEmployeeList"
DoCmd.Close acForm, "FrmEmployeeList"
stDocName = "FrmEmployeeCurrentData"
DoCmd.OpenForm "FrmEmployeeCurrentData", , , stLinkCriteria
Exit_CmdOpenEmplList_Click:
Exit Sub
Err_CmdOpenEmplList_Click:
MsgBox Err.Description
Resume Exit_CmdOpenEmplList_Click
End Sub