Page 1 of 1

[Solved] How to insert/create a grid

Posted: Mon Mar 12, 2012 2:57 pm
by however
hello,
finally, it appears that I am grasping the OOBase structure flexibility (which seems to start making sense more than Access) especially when it comes to table and form design. Thanks to Villeroy's link on "DB filter examples, I also understood the concept of filtering data within forms.
So much so, that now I prefer to create my forms in design mode, rather than using the wizard; however, I still can't reproduce the 'grid' design in subforms (similar to that of an excel datasheet).
I have a main form, Visit, and would like to add 2 subforms, VisitType and Clinic, as datasheets (not fields and labels) so that each grid would show filtered data accordingly.
Do I insert an actual excel sheet and define the columns and rows and then link them to the data source table?
Regards,

Re: re.: how to insert/create a grid

Posted: Mon Mar 12, 2012 3:55 pm
by Villeroy
Toolbar "Form Controls">button "More Controls">toolbar "More Controls">button "Table Control" (silly, isn't it?)
Draw the rectangle, cancel the wizard if a wizard pops up.
Use the form navigator (toolbar "Form Design, button #5) to check if the grid belongs to the right subform. You can drag it to the right place if it was created for the wrong form.
The table control (grid) is not a form control in its own right. It has no data properties. It bundles other form controls in columns showing one instance of each form control in each row.
Right-click the column header and add the form controls you need. For a many-to-many relation you want a list box to get the effect of list boxes in a grid of multiple records.
Alternative methods to add form controls:
Toolbar "Form Design", button #6, drag field names onto the grid's column header, replace the foreign key(s) with a list box.
Let the wizard finish its work and replace the foreign key(s) with a list box.
It is rather irritating and misleading that none of the wizards is able to create list boxes for the foreign keys. You always have to replace some other control with a list box which is why I prefer not using any of these "helpers".


[ListA.ID]1--n[AID BID]n--1[ListB.ID]
ListA is the content of the main form.
The mapping table is the content of the subform connected through the common AID so the subform's grid shows all records with the AID of the main form's selected ID. The subform's BID is represented by a list box in the grid which is filled by some string coming from ListB and its ID as bound column.

Re: How to insert/create a grid

Posted: Tue Mar 13, 2012 8:43 pm
by however
Hi Villeroy,
once again, a BIG thank you. Your info has helped a lot.
Regards