Subform Header Names

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form where the user selects their criteria and then opens a query
subform within another form in datasheet view. Based on the user criteria
from the first form, I want to change the Header names (.Name field) of the
subform columns. How and where should I apply the code to change the
subform!Column.Name before the subform is displayed to the user? From my
understanding, the only way is to change the Name property of the subform is
in design view. Is there a command to change the Name property? I looked for
the Capition property, however when the subform is within another form, there
is no Caption just Name property.

Thanks,
Matt
 
I am assuming your talking about a form within a form here. If your just
opening a form as a popup form that appears in front of your main form this
will be easier than if it is a true subform. When I have done something
similar to this in the past I have had to do it from the main form. There is
a difference though, I was opening the main form from another form and had to
set a property in the subform to display certain data. In the Onload event
for the main form I placed criteria and based the actions to be taken on
information in the form that opened my data form. To refer to an object or
property of the subform you have to go through the main form
(i.e."MainForm!subForm.object.property").
 
I have my 3 form Main.Frm, ZipCode.Frm, and Customer.SubFrm. The Main.Frm is
where the user enters the criteria, then clicks refresh to open the
ZipCode.Frm. In the ZipCode.Frm, there is the subform Customer.SubFrm, which
is displayed in datasheet view. When the user clicks refresh I want the
Customer.SubFrm column Name to be dependent on a combo box value from the
Main Form. I can manually go into the Customer.SubFrm design view and change
the Name property, however I would like to automate this. I tried
ZipCode!Customer.Column1.Name = "Value", however I recieved an error message.
Any ideas, I am really struggling w/ this one.

Thanks,
Matt
 
Back
Top