J
JohnB
Hi. I'm sure this one will be simple. I have an On Open event (see below) in
Form called frmSetImage that's designed to check a field value and stop the
form opening if there is content in the field. I've got as far as showing a
message but when I click on the MsgBox OK button, the form opens. What could
I add that shows the message and then stops the form opening after OK is
clicked? Or have I get too far by then? I could check for content in the
same field in form frmStudents, which has a command button that calls up
frmSetImage but I don't know which event to use. Using On Lost Focus dosen't
work.
Thanks for any help. JohnB
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Me![txtImagePathAndFile]) Then
MsgBox "Photo already allocated"
End If
End Sub
Form called frmSetImage that's designed to check a field value and stop the
form opening if there is content in the field. I've got as far as showing a
message but when I click on the MsgBox OK button, the form opens. What could
I add that shows the message and then stops the form opening after OK is
clicked? Or have I get too far by then? I could check for content in the
same field in form frmStudents, which has a command button that calls up
frmSetImage but I don't know which event to use. Using On Lost Focus dosen't
work.
Thanks for any help. JohnB
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Me![txtImagePathAndFile]) Then
MsgBox "Photo already allocated"
End If
End Sub