Close disabled on open

L'apprentis

Redcifer
Local time
Yesterday, 19:56
Joined
Jun 22, 2005
Messages
177
I am trying to get one of my form impossible to be closed until a event occur.
I have tryed to write the following event on the open event of the form and it doesn't work. Does anybody know why?
Code:
Forms!FrmNewDrawingFile.CloseButton = False
 
Trap it with the forms Unload event, that way even if they try to exit the database they are still traped :)

Code:
Private Sub Form_Unload(Cancel As Integer)
    If MsgBox("Close form?", vbYesNo) = vbYes Then
        Exit Sub
    Else
        Cancel = True
    End If
End Sub

HTH

Peter
 
Thank you again Ghudson, I am not sure I understand everything but it works.
It didn't expect it to be so tricky, i am going to have a look into it though..
 

Users who are viewing this thread

Back
Top Bottom