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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I set column widths on a subform?

Status
Not open for further replies.

VictoriaWass

Programmer
Jul 14, 2001
12
0
0
GB
I have placed a subform on my main form, and its source object is a stored procedure.
How do I set the column widths within the subform? I have a feeling I must be missing something very obvious here, but I am new to subforms, so bear with me.
Additionally, I want the subform to display only the rows returned by the stored procedure where the reference number is equal to one held in a text box on the main form. Is a subform the right way forward, using master and child fields?
Essentially all I want is a datagrid!

Thanks
 
When you modify the form, view the form change the columns to the size you want and save the form. Access will remember the column widths (Access will remember the last column sizing that any user makes, so be aware of this when people start using the app).

As for the linking, you need to configure the parent/child master fields to accomplish the correct records showing. Once that's done, Access does all the rest of the work.

HTH Joe Miller
joe.miller@flotech.net
 
Thanks for your help Joe, but I'm still having a few problems.

When I open the main form in design view the subform is blank, apart from the name of the stored procedure it will be populated from. The only time I see the columns is when I go into form view. I've adjusted the columns here and gone into the file menu and saved it. But when I open the form the next time, the column widths are back to what they were before. I thought the subform would have been a form in its own right, which I could go into and design separate from the main form, but this does not appear to be the case. The subform seems to simply be a control on the main form. Is this right? Perhaps I've made a more fundamental error in setting it up.

Thanks again
 
The subform object on a main report appears as a blank control would with none of the controls from the subform showing (in access 97 and prior). When you double-click on the sub-form object, you can edit the subform fields themselves. You only edit the form view of all forms (regardless of view to the user, ie: datasheet/continuous/single form) in the single form mode. For datasheet mode, access converts all fields on the single form and puts them in a "datagrid" with the tab order of the controls being the column order in the datagrid.

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top