Subform Object source

I

ITperson

Hello

I have a main form that when it opens, it opens another form for searching.
When a value is typed into this form and you hit enter, it looks up the value
and displays its record on the main form > works fine.

I have several button in this main form. Each button opens a separate
subform as a objectsource into an area on the main form.

What I have is a subform (accessed by one of the buttons) that has a
checkbox. This checkbox is not visible unless there are values in the
invisible textboxes. When the checkbox is checked, it displays 6 textboxes
for the user to fill in. Not all records will have values for these boxes,
so the textboxes should remain invisible because the value for the checkbox
is "false".

When I had this subform as an addition to the main form (instead of being a
subform), I placed some code in the "On Focus" field of the main form (since
after doing a search, the focus came back to this field) that would display
the invisible textboxes if the value for the checkbox was true and remain
invisible if the value was false for that record.

However, the problem is since making this a subform, I cannot get the
subform to check the value of the checkbox. I have tried doing a refresh on
the subform, but I cannot seem to get the code to allow me to access the
subform because it uses a "Me!MeetingsSubform.SourceObject =" entry.

There is no "On Click" Event for the button that brings up the subform, it
is part of a toggle set.

I have tried tying the code to the "On Enter" event of the search subform,
but I run into the same problem > access cannot find the subform name.

Any suggestions?

Thank you
Terry
 
M

Marshall Barton

ITperson said:
I have a main form that when it opens, it opens another form for searching.
When a value is typed into this form and you hit enter, it looks up the value
and displays its record on the main form > works fine.

I have several button in this main form. Each button opens a separate
subform as a objectsource into an area on the main form.

What I have is a subform (accessed by one of the buttons) that has a
checkbox. This checkbox is not visible unless there are values in the
invisible textboxes. When the checkbox is checked, it displays 6 textboxes
for the user to fill in. Not all records will have values for these boxes,
so the textboxes should remain invisible because the value for the checkbox
is "false".

When I had this subform as an addition to the main form (instead of being a
subform), I placed some code in the "On Focus" field of the main form (since
after doing a search, the focus came back to this field) that would display
the invisible textboxes if the value for the checkbox was true and remain
invisible if the value was false for that record.

However, the problem is since making this a subform, I cannot get the
subform to check the value of the checkbox. I have tried doing a refresh on
the subform, but I cannot seem to get the code to allow me to access the
subform because it uses a "Me!MeetingsSubform.SourceObject =" entry.


References to controls on a subform do not use the name of
the form object displayed in the subform control. You only
need to use the Form property of the subform control.

Me.subformcontrolname.Form.textboxname
 
I

ITperson

Marshall Barton said:
References to controls on a subform do not use the name of
the form object displayed in the subform control. You only
need to use the Form property of the subform control.

Me.subformcontrolname.Form.textboxname
Marsh
Thank you, that worked great.
 

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