Hiding a Form (Completely) A97

K

Kahuna

Hi Folks - been one of those days... Code which worked beautifully yesterday
is now broken (I broke it - obviously lol)!!!

I am using a form to open initially on load of my app - as a Start-Up form -
just running set-up code. Upto today it was closed by the splash form, after
it'd done the job, but now I want to leave it open to use as a timer.

Seems like Forms![frmStartup].Hide (from the SplashForm Load) should hide
the form but it errors with object not defined error. The form remains as a
grey box even if set to Me.Visible = False?

Any suggestions gratefully received.
 
R

Rick Brandt

Kahuna said:
Hi Folks - been one of those days... Code which worked beautifully
yesterday is now broken (I broke it - obviously lol)!!!

I am using a form to open initially on load of my app - as a Start-Up
form - just running set-up code. Upto today it was closed by the
splash form, after it'd done the job, but now I want to leave it open
to use as a timer.
Seems like Forms![frmStartup].Hide (from the SplashForm Load) should
hide the form but it errors with object not defined error. The form
remains as a grey box even if set to Me.Visible = False?

Any suggestions gratefully received.

Forms![frmStartup].Visible = False
 
K

Kahuna

Tried that Rick - but for some reason it leaves a Grey Box on the main
background.

The only workaround I have so far is to close the frsmStartUp form and
reopen it with

DoCmd.OpenForm "frmStartup", acNormal, , , acFormEdit, acHidden. This seems
to be working but my concern is that its too sloppy!

frmStartUp is opened as the first when running the app, using the display
form element of the Access start-up settings.

Is there anyway to have this form open hidden from there?

--
Kahuna
------------
Rick Brandt said:
Kahuna said:
Hi Folks - been one of those days... Code which worked beautifully
yesterday is now broken (I broke it - obviously lol)!!!

I am using a form to open initially on load of my app - as a Start-Up
form - just running set-up code. Upto today it was closed by the
splash form, after it'd done the job, but now I want to leave it open
to use as a timer.
Seems like Forms![frmStartup].Hide (from the SplashForm Load) should
hide the form but it errors with object not defined error. The form
remains as a grey box even if set to Me.Visible = False?

Any suggestions gratefully received.

Forms![frmStartup].Visible = False
 
R

Rick Brandt

Kahuna said:
Tried that Rick - but for some reason it leaves a Grey Box on the main
background.

The only workaround I have so far is to close the frsmStartUp form and
reopen it with

DoCmd.OpenForm "frmStartup", acNormal, , , acFormEdit, acHidden. This
seems to be working but my concern is that its too sloppy!

frmStartUp is opened as the first when running the app, using the
display form element of the Access start-up settings.

Is there anyway to have this form open hidden from there?

Have you tried coding...

Me.Visible = False

....in the form's Open or Load event?

You could also remove it from the startup properties and open it hidden from an
AutoExec macro. (any macro named "AutoExec" will fire when the file is opened).
 
K

Kahuna

That's what I tried Rick - it eaves a grey square (in the shape of the small
form) attribute on the screen.
 
R

Rick Brandt

Kahuna said:
That's what I tried Rick - it eaves a grey square (in the shape of
the small form) attribute on the screen.

I have never seen that upon hiding a form. Perhaps you have a video driver
issue.

Anyway, did you try the AutoExec Macro? While macros are generally frowned upon
the AutoExec and AutoKeys macros have legitimate uses. With AutoExec you can
have it run a single command "RunCode". That way you are still doing everything
in VBA. You are just using AutoExec to fire it.
 
K

Kahuna

I've not tried the AutoExec Rick since (as you said) I know its frowned
upon!

I am going to try it on another PC to see what happens - but the challenge
is if it happens here (driver defect or not) its possible to happen on a
clients desk - so its essential to fix it. It's working right now with my
close / open hidden workaround.

I'll trial it and see which way works best (stay away from the macro if
possible).

Cheers Rick - you must be driven crazy with all this support stuff - do you
sleep at all? lol.
 

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