Subform won't rehide

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Pleeeaaase Help!

I have a subform that is hidden until a condition is met. So far no
problem. Where I'm running into trouble is after I enter the required
information in the subform I can't get it to go away. I have tried various
ways to rehide it using suggestions from other posts but so far nothing has
worked.

I've tried the following in several different events of the form but keep
getting some kind of error, usually "can't find the form fsubAccessories
referred to"

Forms![fsubAccessories].Visible = False

What is it that I'm doing wrong?

Would greatly appreciated any advice you can give me.
 
Hi.
What is it that I'm doing wrong?

You're referring to the subform as if it were a form. It isn't. When the
main form is open, the main form is a member of the Forms Collection and the
subform isn't -- because it's a control on the main form. Determine the name
of the control, and you'll be able to manipulate the subform in code. In the
main form's code module, try:

Me!MyCtrlName.Visible = False

.. . . where MyCtrlName is the name of the control displaying the subform.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Gabby Girl said:
Pleeeaaase Help!

I have a subform that is hidden until a condition is met. So far no
problem. Where I'm running into trouble is after I enter the required
information in the subform I can't get it to go away. I have tried various
ways to rehide it using suggestions from other posts but so far nothing has
worked.

I've tried the following in several different events of the form but keep
getting some kind of error, usually "can't find the form fsubAccessories
referred to"

Forms![fsubAccessories].Visible = False

What is it that I'm doing wrong?

Would greatly appreciated any advice you can give me.
 
Thank you so much. Works beautifully.

'69 Camaro said:
Hi.
What is it that I'm doing wrong?

You're referring to the subform as if it were a form. It isn't. When the
main form is open, the main form is a member of the Forms Collection and the
subform isn't -- because it's a control on the main form. Determine the name
of the control, and you'll be able to manipulate the subform in code. In the
main form's code module, try:

Me!MyCtrlName.Visible = False

. . . where MyCtrlName is the name of the control displaying the subform.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Gabby Girl said:
Pleeeaaase Help!

I have a subform that is hidden until a condition is met. So far no
problem. Where I'm running into trouble is after I enter the required
information in the subform I can't get it to go away. I have tried various
ways to rehide it using suggestions from other posts but so far nothing has
worked.

I've tried the following in several different events of the form but keep
getting some kind of error, usually "can't find the form fsubAccessories
referred to"

Forms![fsubAccessories].Visible = False

What is it that I'm doing wrong?

Would greatly appreciated any advice you can give me.
 
You're welcome!

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.


Gabby Girl said:
Thank you so much. Works beautifully.

'69 Camaro said:
Hi.
What is it that I'm doing wrong?

You're referring to the subform as if it were a form. It isn't. When
the
main form is open, the main form is a member of the Forms Collection and
the
subform isn't -- because it's a control on the main form. Determine the
name
of the control, and you'll be able to manipulate the subform in code. In
the
main form's code module, try:

Me!MyCtrlName.Visible = False

. . . where MyCtrlName is the name of the control displaying the subform.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember
that
questions answered the quickest are often from those who have a history
of
rewarding the contributors who have taken the time to answer questions
correctly.


Gabby Girl said:
Pleeeaaase Help!

I have a subform that is hidden until a condition is met. So far no
problem. Where I'm running into trouble is after I enter the required
information in the subform I can't get it to go away. I have tried
various
ways to rehide it using suggestions from other posts but so far nothing
has
worked.

I've tried the following in several different events of the form but
keep
getting some kind of error, usually "can't find the form
fsubAccessories
referred to"

Forms![fsubAccessories].Visible = False

What is it that I'm doing wrong?

Would greatly appreciated any advice you can give me.
 
Back
Top