Hi Scott:
Of course- if the Type A and Type B tests involve totally different table
structures, then you could place 2 subforms on your Parent Form and simply
make one visible depending on the selection. You can place the code in the
After Update event of, say, the combobox:
If combotest.value = "Type A" Then
Subform_A.Visible = True
Subform_B.Visible = False
Else
Subform_B.Visible = True
Subform_A.Visible = False
End If
If you have 2 separate similar tables (with like column structures) or both
types (A and B) are in the same table, you can use the same subform:
For 2 separate, but similar tables-
If combotest.value = "Type A" Then
Subform_A.RecordSource = "SELECT TypeATable.* FROM TypeATable;"
Else
Subform_B.RecordSource = "SELECT TypeBTable.* FROM TypeBTable;"
End If
For 1 table with both recordsets-
If combotest.value = "Type A" Then
Subform_A.RecordSource = "SELECT TypeATable.* FROM TypeATable WHERE
TypeATable.[TypeRecordField] " & Chr(34) & "Type A" & Chr(34) & ";"
Else
Subform_A.RecordSource = "SELECT TypeBTable.* FROM TypeBTable WHERE
TypeBTable.[TypeRecordField] " & Chr(34) & "Type B" & Chr(34) & ";"
End If
There- all you have to do now is to pick your schenario.
Regards,
Al