Visible = false to just close

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
 
M

Marshall Barton

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
 
G

geppo

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
 
G

geppo

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top