multiple subforms based on table on main form

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

Guest

I have a form thatr can uses 4 differnet tables based on a checkbox on anther
form. I need to be avle to poulate the subform from 1 of 4 queries. i.e. if
the main form is showing company 01 then the subforms query should be company
01 query.

I hope this is understandable
 
Checkbox? That cannot have four states. I assume you mean combobox.

Create a second column in your combobox, let's say it is named ctlOther;
have the query names in this column. You must set the ColumnCount
property to 2 (if you had 1 column to begin with), you can hide this
extra column by setting the ColumnWidths property to ,0 (the comma is
the separator between the settings per column. This entry hides the
second column.)

Now, from the Click event of the combobox, execute
subformcontrolName.form.recordsource = ctlOther

pay close attention to the reference: first the control, then its Form
property, from there it is a normal form again with a Recordsource
property as you'd expect. Or maybe you didn't expect a Recordsource
property but believe me, it's there ;-)
 
No I meant 4 check boxes one for each differnet table, but this should still
work.

Thanks
 
4 checkboxes... in an option group, then? Refer to the group control as
I referred to the combobox.

You shouldn't use checkbox layout in an option group, but option
buttons. Toggle buttons if you like.
I find it irritating that checkboxes in a group would be a design option
in any toolkit. A checkbox is meant for a yes/no setting, not for one
option among several.
 
You know it is amazing what you don't think of until it is presented to you.
Then it's like duh, I should have thought of that.

Thanks for all your help.
 
Back
Top