Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot make form invisible

Status
Not open for further replies.

JTBorton

Technical User
Jun 9, 2008
345
DE
Access 2007 - I am trying to make a form invisible when it loads, but it still shows.

I used the following code as well as Me.Visible = False. Neither work
Code:
     Forms!frmSplash.Visible = False

-Joshua
If it's not broken, it doesn't have enough parts yet.
 
Okay I tried moving focus to the new form but it is still not working. The Splash form remains visible and focus will not pass to the new form.

Code:
    DoCmd.OpenForm "frmDashBoard", acNormal
    Forms("frmDashBoard").SetFocus
    Forms!frmSplash.Visible = False

-Joshua
If it's not broken, it doesn't have enough parts yet.
 
Yes, I set break points and stepped through the code line by line. It executes but does not change the focus of the forms.

-Joshua
If it's not broken, it doesn't have enough parts yet.
 
Dialog as in a pop-up dialog box? No, it is opened as a normal form. There are no controls on the form, it is simply a blank form that I use to process some code when the user opens and closes the database.

-Joshua
If it's not broken, it doesn't have enough parts yet.
 
Okay here's some interesting info - When I double click on the form from the object list box to open it, the code from the Splash Form opens the Dashboard form but does not hide the Splash form. But - if I open the Splash form first in design view, then click 'Form View' then all of the code performs correctly and hides the Splash form. Any idea?

-Joshua
If it's not broken, it doesn't have enough parts yet.
 
The code works for me. I didn't have to even open another form. This code worked to hide the form:
Code:
Private Sub cmdHideSplash_Click()
On Error GoTo Err_cmdHideSplash_Click
    
    Forms!frmSplash.Visible = False
    

Exit_cmdHideSplash_Click:
    Exit Sub

Err_cmdHideSplash_Click:
    MsgBox Err.Description
    Resume Exit_cmdHideSplash_Click
    
End Sub

Duane
Hook'D on Access
MS Access MVP
 
I noticed I never added the solution for this problem. I solved it by doing the reverse of what I originally wanted. Instead of using the splash screen to load the dashboard form and then hide itself, I used the dashboard form to load and then hide the splash form. The splash form was supposed to remain open and run code while hidden in the background anyway, so it worked out good.

-Joshua
If it's not broken, it doesn't have enough parts yet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top