Form.Visible and DoCmd.OpenForm

R

Rajesh Candamourty

Dear All,

What's the major difference between
FormName.Visible = True and
DoCmd.OpenForm "Form Name"

Will this affect the size of the code/file? or uses much of the resource.
Which is advisable to use?

Any help is highly appreciated.

Thanks.
Raj.
 
R

Rick Brandt

Rajesh said:
Dear All,

What's the major difference between
FormName.Visible = True and
DoCmd.OpenForm "Form Name"

Will this affect the size of the code/file? or uses much of the
resource. Which is advisable to use?

Any help is highly appreciated.

The first only works if the form is already opened but hidden. The second
will show a hidden form or open a closed form.
 
B

Baz

Rajesh Candamourty said:
Dear All,

What's the major difference between
FormName.Visible = True and
DoCmd.OpenForm "Form Name"

Will this affect the size of the code/file? or uses much of the resource.
Which is advisable to use?

Any help is highly appreciated.

Thanks.
Raj.

The major difference is that FormName.Visible will not work. Presumably you
are thinking of:

Forms!frmSomeForm.Visible = True

However, this will only work if the form is already open.

DoCmd.OpenForm will open the form if it is not open, and will show it if it
is already open.

I've no idea which is the more efficient way of showing an already-open
form: given the power of today's computers, I doubt that it's worth worrying
about.
 

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