Visible = false to just close

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code makes a form Not-Visible. I'd like to change it to just close the
form!
Could someone help me with how to change this code?

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open

Forms!f_Hello.Visible = False

Exit_Form_Open:
Exit Sub

Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open

End Sub
 
Dan @BCBS said:
This code makes a form Not-Visible. I'd like to change it to just close the
form!
Could someone help me with how to change this code?

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open

Forms!f_Hello.Visible = False


DoCmd.Close acForm, "f_Hello", acSaveNo
 
Ciao said:
This code makes a form Not-Visible. I'd like to change it to just
close the form!
Could someone help me with how to change this code?

Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Err_Form_Unload

Forms!f_Hello.Visible = true

Exit_Form_Unload:
Exit Sub

Err_Form_Unload:
MsgBox Err.Description
Resume Exit_Form_Unload

End Sub
 
geppo said:
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Err_Form_Unload

Forms!f_Hello.Visible = true

Exit_Form_Unload:
Exit Sub

Err_Form_Unload:
MsgBox Err.Description
Resume Exit_Form_Unload

End Sub


Hi boys, are Italian and as usual I don't understand anything.
 
Back
Top