Show record source in a text box

P

Presto

I need to weed out a very overcrowded database. I need to remove the queries
that are no longer needed. I need to quickly see the record source for all
the forms. On each form, I already have a subform called "Tasks". I would
like to have the main forms record source listed on that subform when it's
opened. How can I do this? I tried =Me.Form.RecordSource but it doesnt
work no matter where I put it,either on the main form or the subform.
 
D

Douglas J. Steele

If I'm understanding you correctly (i.e. you're trying to show the name of
the parent form's recordset in a text box on a subform), try

=Me.Parent.RecordSource

or

=Me.Parent.Form.RecordSource
 
P

Presto

Thanks Doug, but it keeps coming up with #Name? if I put either example on
the subform or the main form. Either way, it won't work.
 
P

Presto

If I put =[RecordSource] on the main form it will show the query name. I
was hoping to get it on the Tasks subform so I only have to edit one form,
then when I'm done, I can remove it easily.
 
M

Marshall Barton

Presto said:
I need to weed out a very overcrowded database. I need to remove the queries
that are no longer needed. I need to quickly see the record source for all
the forms. On each form, I already have a subform called "Tasks". I would
like to have the main forms record source listed on that subform when it's
opened. How can I do this? I tried =Me.Form.RecordSource but it doesnt
work no matter where I put it,either on the main form or the subform.

Me is not valid in a control expression. The main form can
refer to its own record source using =Form.RecordSource.
The subform can refer to the main form's record source using
=Parent.RecordSource
 
P

Presto

YES!!! =Parent.RecordSource works!! Thank you Marshall! and Thank you
Doug for your input too.
 

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