J
jo
Hi guys the following code that is attached to a command button covers
certain conditons and works fine. But my problem is this: when the user opens
the form and then decides not to use the form and wants to close it the code
does not close because there is not a condition to cover that aspect. I dont
know what to add to the code to cover a form that has been opened but has not
yet created a record.(the form is totally blank until the user selects a
[TYPE]). Your help would be most appreciated..
Option Compare Database
Function boreclose()
On Error GoTo boreclose_Err
With CodeContextObject
If (.CheckChoice = 1 And .Ring2c = "Not Approved") Then
Beep
MsgBox "Not Approved select Setting", vbExclamation, "Not
Approved"
End If
If (.CheckChoice > 1 And .Ring2c = "Not Approved") Then
DoCmd.RunMacro "CloseBore", , ""
End If
If (.Ring2c = "Routine Approved") Then
DoCmd.RunMacro "CloseBore", , ""
End If
End With
boreclose_Exit:
Exit Function
boreclose_Err:
MsgBox Error$
Resume boreclose_Exit
End Function
certain conditons and works fine. But my problem is this: when the user opens
the form and then decides not to use the form and wants to close it the code
does not close because there is not a condition to cover that aspect. I dont
know what to add to the code to cover a form that has been opened but has not
yet created a record.(the form is totally blank until the user selects a
[TYPE]). Your help would be most appreciated..
Option Compare Database
Function boreclose()
On Error GoTo boreclose_Err
With CodeContextObject
If (.CheckChoice = 1 And .Ring2c = "Not Approved") Then
Beep
MsgBox "Not Approved select Setting", vbExclamation, "Not
Approved"
End If
If (.CheckChoice > 1 And .Ring2c = "Not Approved") Then
DoCmd.RunMacro "CloseBore", , ""
End If
If (.Ring2c = "Routine Approved") Then
DoCmd.RunMacro "CloseBore", , ""
End If
End With
boreclose_Exit:
Exit Function
boreclose_Err:
MsgBox Error$
Resume boreclose_Exit
End Function