Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

record source for subform

Status
Not open for further replies.

lewie

Technical User
Jan 17, 2003
94
US
I have some forms that have subforms. What is the correct way to determine the record source of a subform. Can i select properties on the main form, scroll down to the subform name select it and find the record soure under properties or do i need to open the subform independently.
Thanks.
lewie
 
You can do it with the main form open, if you have Access 2000 or later. Normally, the subform will be visible through the subform control. In the upper left corner of the subform is a blank square box (the "form selector"). Click that, and the properties of the subform Form object will be displayed in the Properties sheet.

If you're using Access 97, you have to open the subform from the Database Window.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Thanks. I just seem to be viewing conflicting data.
If I use the form selector on the main form right click and select properties i get a form . If I scroll down through the selection box at the top through the controls on the form and when i get to the subform and select data tab, It shows the source object, link master field, and link child fields. what value is in the source object field? I thought it would be the form name but it doesn't match the form name i selected in the drop down box.
Thanks.
Lewie
 
Well, I'm a little confused, since originally you were talking about the record source (a form property) and you're talking about the subform control's properties.

Are you looking at the properties while the form is in Form View? That could be causing confusion, because the properties shown are the runtime properties, which could be different from the properties stored with the form because they may have been changed at runtime. Also, if you have opened the form in Form View and clicked the Save button, some of the design-time properties may have been overwritten by run-time values. (This happens a lot with the Filter property, for example.)

Do you have code that's changing the SourceObject property? Somebody was asking how to do that in VBA code earlier today. Was that you?

The Source Object property shouldn't change, I don't think. How different is it from the form name you set at design time?

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
It's nothing like that. I am in design mode. I have a form and a subform. I am tracing them out and need the record sources of the 2 forms.
I get confused on the record source of the subform. If i open the subform it says one thing. If i open the main form go to properties then select the subform so it shows the subform properties there is different data. So I am thinking the way to be sure i get the right record source is to just open the subform and go to the data tab.
Thanks.
Lewie
 
What version of Access are you using? I'm not very familiar with Access later than 2000. It could be something changed that I don't know about.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
I am using office xp with windows 2000
 
That's Access XP (Access 2002) then. It might actually be different.

Have you tried using the Immediate Window to debug.print the property value?

The subform control's Source Object property should be the name of the (sub-) form in the Database Window.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top