Here is an easy way to do this:
Use the combo box wizard to select the field Hoofdgroep from tblHoofdgroep. This combo box should also select the PK for the records, but hide that and use it as the bund column, unless Hoofdgroep IS the PK for this table. Let's call this cboHoofdgroep.
Create a second combo box for Subgroep looking up in the tblSubEnHoofdgroepBA06 table, and include the Hoofdgroep FK field in the fields in the list (the fields should be the OPK field for tblSubEnHoofdgroepBA06, Subgroep, and Hoofdgroep FK). Let's call this cboSubGroep.
Then open the properties dialog box for cboSubGroep, and selec the data tab. Click on the Row Source, and open the query designer. In the column for the Hoofdgroep FK field, add this line in the Criteria:
[Forms]![frmYourFormName].[cboHoofdGroep]
Then Uncheck the Show check box. Don't click the save button, just close the query designer, and check yes to save the changes.
Go to the Format tab, and remove the last ";1" from the Column Widths list.
Then go to the After Update event of the cboHoofdGroep, and add this code:
Me.cboSubGroep.Requery
Did that work for you?
mmcdonal
|