Help with subform

N

Nathan Guill

I am toying with the idea of having a subform in my switchboard. This
subform would be unbound until a menu item was selected that changed its
sourceobject. What I want to know is if there is a way for the
(sourceobject)form to tell that is is being used as a subform and then
unbind from the parent form? This is so that I can use the same forms and
controls if the form is used as a subform or as a full form depending on how
it was called.
 
G

George Nicholson

One way: Test for Me.Parent. It will raise an error (2452) if Me doesn't
refer to a form currently being used as a subform.

Then you can set the form's Recordsource, etc., based on the results of that
test.
 
N

Nathan Guill

Thank you. That's what I was looking for.

George Nicholson said:
One way: Test for Me.Parent. It will raise an error (2452) if Me doesn't
refer to a form currently being used as a subform.

Then you can set the form's Recordsource, etc., based on the results of that
test.
 
N

Nathan Guill

Well, I was able to test for the parent, but how do I unbind the
sourceobject in a subform while the form is open? Basically, I want to be
able to "close" the subform. Is this possible?
 

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