Form.Visible and DoCmd.OpenForm

  • Thread starter Thread starter Rajesh Candamourty
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top