Form Name is not the same as the ctl.Name

sierra467

Registered User.
Local time
Today, 16:16
Joined
Aug 1, 2005
Messages
66
I have a form named "sfrmSumaryTotalPerDate_frmReports" in the database window. This form is a sub form of frmReports and when I loop through the sub forms in frmReports in VBA, I am told that its name is "sfrSummaryTotalPerDate" (ctl.Name).

Why is this discrepancy occurring and how can I sync the 2 of them back together?
 
The 2 do not have to be the same. If you used the subform wizard, there is a point at which you are asked for the name of the control. My guess is that it was given the shorter name at that point.
 
Sorry, to get them back in sync look at the control's properties. It has a name property, which is what you want to change.
 
Why is there no name property for the form? There is one for the header and footer but I can not seem to find one for the form.
 
You mean the subform? You have to be viewing the properties of the subform control to see the name property (which refers to the name of the control, not the name of the form/subform).
 
I thought I was. I had the form open and right clicked on the subform and looked in the properties, but found no name property. Am I doing something wrong?
 
OK, Thanks pbaldy, I now see what you mean.

I can not double click in the upper left box of the subform to get the properties as you do with regular forms. You have to select the subform so that the 8 sizing dots show and then right click on the subform to get the properties that way. Your statement about the control made the difference in my mind.

It solved the issue for me and I really appreciate it - THANKS!
 
Apparently. You don't want to look at the subform itself, you want the subform control of the main form. Easiest way I can describe it is (in design view) click on the control name (sfrSummaryTotalPerDate) in the object browser in the toolbar (dropdown box listing all the controls on the form). Then select View/Properties. The first 2 properties you should see on the "All" tab are Name and Source Object. That will tell you that you got the subform control.
 
Sorry, typed too slow. Glad you got it sorted out.
 

Users who are viewing this thread

Back
Top Bottom