DoCmd.Close Not Working (1 Viewer)

brianrr23

New member
Local time
Today, 07:15
Joined
Mar 5, 2014
Messages
5
I am unable to get a form to close with the following code. "DoCmd.Close acForm, "frmStudentLookup", acSaveNo" works by itself, but not following the DoCmd.Open. However, If frmStudentInfo is already open it works just fine.

If rcCount = 0 Then
MsgBox "No Record found", vbInformation, "Message"
ElseIf rcount = 1 Then
DoCmd.OpenForm "frmStudentInfo", acNormal, , "StudentInfo.[ID] = '" & Me.[Text0] & "'", acFormReadOnly
DoCmd.Close acForm, "frmStudentLookup", acSaveNo
Else
DoCmd.OpenForm "frmStudentInfo", acFormDS, , "StudentInfo.[ID] = '" & Me.[Text0] & "'", acFormReadOnly
DoCmd.Close acForm, "frmStudentLookup", acSaveNo
End If

Thanks in advance for your help.
 

Users who are viewing this thread

Top Bottom