docmd.openform

  • Thread starter tg112001 via AccessMonster.com
  • Start date
T

tg112001 via AccessMonster.com

Is there a way to open a form without making it visible from the start?
Here's sample code to help explain:

DoCmd.OpenForm "form1", acNormal
Me.Visible = False
Me.Combo1.RowSource = ""
DoCmd.Close acForm, "Country_BT_Land_APAC", acSaveYes

The minor problem with this is that the form is visible for a split second,
and then becomes invisible - which looks like a flicker. Since I have to do
this with 4 forms at one time, there will be 4 flickers. I'm trying to
elimate the flicker problem.

Thanks!
 
D

Douglas J. Steele

DoCmd.OpenForm "form1", acNormal, , , , acHidden

or

DoCmd.OpenForm "form1", acNormal, WindowMode:= acHidden

(Note that there's colon before the equal sign in the second syntax)
 
J

Jeanette Cunningham

Hi,
DoCmd.OpenForm "form1", , , , , acHidden
will usually open a form without any flicker

Jeanette Cunningham
 
F

fredg

Is there a way to open a form without making it visible from the start?
Here's sample code to help explain:

DoCmd.OpenForm "form1", acNormal
Me.Visible = False
Me.Combo1.RowSource = ""
DoCmd.Close acForm, "Country_BT_Land_APAC", acSaveYes

The minor problem with this is that the form is visible for a split second,
and then becomes invisible - which looks like a flicker. Since I have to do
this with 4 forms at one time, there will be 4 flickers. I'm trying to
elimate the flicker problem.

Thanks!

It's not clear from your post which form your code is on.
Is it " "Country_BT_Land_APAC"?
If so, why are you making it not visible if you intend to close it?
Anyway you can open a form as acHidden.

Me.Combo1.Rowsource = ""
DoCmd.OpenForm "Form1", acNormal, , , , acHidden
DoCmd.Close acForm, "Country_BT_Land_APAC", acSaveYes
 
T

tg112001 via AccessMonster.com

Thanks everyone... acHidden it is!

Fred - "Country_BT_Land_APAC" is really "Form1". I forgot to replace that.



Is there a way to open a form without making it visible from the start?
Here's sample code to help explain:
[quoted text clipped - 10 lines]

It's not clear from your post which form your code is on.
Is it " "Country_BT_Land_APAC"?
If so, why are you making it not visible if you intend to close it?
Anyway you can open a form as acHidden.

Me.Combo1.Rowsource = ""
DoCmd.OpenForm "Form1", acNormal, , , , acHidden
DoCmd.Close acForm, "Country_BT_Land_APAC", acSaveYes
 
T

tg112001 via AccessMonster.com

AcHidden still does a flicker, but not as noticable as .Visible

Also, after compiling the MDB to a MDE, it crashes because AcHidden doesn't
work for MDE or ADE.

So, I'll revert back to .Visible

FYI
Thanks everyone... acHidden it is!

Fred - "Country_BT_Land_APAC" is really "Form1". I forgot to replace that.
[quoted text clipped - 10 lines]
DoCmd.OpenForm "Form1", acNormal, , , , acHidden
DoCmd.Close acForm, "Country_BT_Land_APAC", acSaveYes
 
J

Jeanette Cunningham

acHidden will work in a mde, I haven't tried it in a mda.

DoCmd.OpenForm "Country_BT_Land_APAC", acNormal
Me.Visible = False
Me.Combo1.RowSource = ""
DoCmd.Close acForm, "Country_BT_Land_APAC", acSaveYes

It looks as if you are opening a form,
making it invisible,
clearing its combo row source
then closing it.
Repeating the above with 3 more forms

This seems to be a fairly unusual thing to do.
why is it flickering?
what else is open at the same time?
It's possible, if you tell us a little more about what you are trying to
achieve that we could suggest an alternative that doesn't flicker.

Jeanette Cunningham

tg112001 via AccessMonster.com said:
AcHidden still does a flicker, but not as noticable as .Visible

Also, after compiling the MDB to a MDE, it crashes because AcHidden
doesn't
work for MDE or ADE.

So, I'll revert back to .Visible

FYI
Thanks everyone... acHidden it is!

Fred - "Country_BT_Land_APAC" is really "Form1". I forgot to replace
that.
Is there a way to open a form without making it visible from the start?
Here's sample code to help explain:
[quoted text clipped - 10 lines]
DoCmd.OpenForm "Form1", acNormal, , , , acHidden
DoCmd.Close acForm, "Country_BT_Land_APAC", acSaveYes
 

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