WalterInOz
Registered User.
- Local time
- Tomorrow, 02:57
- Joined
- Apr 11, 2006
- Messages
- 93
I'm trying to close a form (frmIN) that shows details of selected correspondence about a project and go back to the main form (frmMain) of that particular project.
I'm using the code below that doesn't work properly. I get error message '2501 - OpenForm action was cancelled'
Anyone any suggestions as to what is wrong with the code and why?
Thanks for your help,
Walter
Private Sub btnClose_Click()
Dim StrMsg As String
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmIN"
DoCmd.Save
stDocName = "frmMain"
stLinkCriteria = "[projectID]=" & "'" & Me![ProjectID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
stDocName = "frmIN"
DoCmd.close
End Sub
I'm using the code below that doesn't work properly. I get error message '2501 - OpenForm action was cancelled'
Anyone any suggestions as to what is wrong with the code and why?
Thanks for your help,
Walter
Private Sub btnClose_Click()
Dim StrMsg As String
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmIN"
DoCmd.Save
stDocName = "frmMain"
stLinkCriteria = "[projectID]=" & "'" & Me![ProjectID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
stDocName = "frmIN"
DoCmd.close
End Sub