I am a complete novice at VBA. I have a command button on a form, (PrisonersBySurname), that has the following code attached which opens a new form, (Prisoner_Details). would like to add code that closes the original form when the new form opens. Any ideas?
Private Sub OpenPrisonerDetailsBtn_Click()
On Error GoTo Err_OpenPrisonerDetailsBtn_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Prisoner_Details"
stLinkCriteria = "[Spin]=" & Me![Spin]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenPrisonerDetailsBtn_Click:
Exit Sub
Err_OpenPrisonerDetailsBtn_Click:
MsgBox Err.Description
Resume Exit_OpenPrisonerDetailsBtn_Click
End Sub
Private Sub OpenPrisonerDetailsBtn_Click()
On Error GoTo Err_OpenPrisonerDetailsBtn_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Prisoner_Details"
stLinkCriteria = "[Spin]=" & Me![Spin]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenPrisonerDetailsBtn_Click:
Exit Sub
Err_OpenPrisonerDetailsBtn_Click:
MsgBox Err.Description
Resume Exit_OpenPrisonerDetailsBtn_Click
End Sub