How can I check if a sub form was expanded?

T

TazQuebec

Please look at the print screen first
http://advenet.com/photos/tazquebec/images/3295/original.aspx
http://advenet.com/photos/tazquebec/images/3296/original.aspx

I want to perform an operation went a sub form has been expanded.

I need access to the fields of the sub form on the click even of a button.

Forms![BASE].Controls("subfrmBase").Controls("frmSoumission_CTS").Controls
("frmSoumission_CTS_Elements")!drpdwn_ref_Element.Value

If the sub form was not expanded I get an error.

I want to display a message when that happens.

If the sub form was expanded and then decreased, then I have access to the
fields.

In that case I want to be able to check for that.

Basically, I want to know if the user is on a record of the sub form.

Thanks for the help
 
T

Tom van Stiphout

You could put in an Error Handler. Then when you try to read the value
you get a specific error. You can test for that, and show your
message.

-Tom.
Microsoft Access MVP
 
T

TazQuebec via AccessMonster.com

I thought about that but if the sub form was expand and then shrink, I need
to know. Using an Error Handler will not help in that case.

Here is more information on my problem.

When the form is first open the sub form "frmSoumission_CTS_Elements" of the
Subform frmSoumission_CTS is not expand. There are not controls defined.

When the sub form "frmSoumission_CTS_Elements" is expand by pressing the plus
sign. The controls are then defined.

I have access to the fields of the sub form I want to reach.

Forms![BASE].Controls("subfrmBase").Controls("frmSoumission_CTS").Controls
("frmSoumission_CTS_Elements")!ref_SCTS

If the sub form of the fields I need access to is shrink, I still have access
to them. Which, I also need to know.

So what I need is to know if the user is now pointing to a record of my sub
form "frmSoumission_CTS_Elements".


Thanks

You could put in an Error Handler. Then when you try to read the value
you get a specific error. You can test for that, and show your
message.

-Tom.
Microsoft Access MVP
[quoted text clipped - 19 lines]
Thanks for the help
 

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