Open a form in hidden view

S

Sam

I'm trying to have data export whenever the database closes. After looking
around on this site and others, it seems like the best way to do this is to
have a form open in the hidden mode when the Access database opens, and have
this "invisible" form trigger the export when it's closed, which is when the
database closes.

I can't get the form to open in hidden mode, however. I use this code to
call the function:

Private Sub Form_Open(Cancel As Integer)
Call Open_Form_Hidden
End Sub

The function called:

Public Sub Open_Form_Hidden()
DoCmd.OpenForm "Test", acNormal, , , , acHidden
End Sub

I've also tried changing the Visible property to false, but neither of these
do what I need. Does anyone have a suggestion for me?

Thanks,
Sam
 
D

Douglas J. Steele

AFAIK, you can't hide a form once you've opened it: you need to open it
hidden.

Either call Open_Form_Hidden from some other form, or use an AutoExec macro
to open it when the application first opens.
 

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