ranman256, thank you for your input.
Luckily one of my coworkers was able to figure it out. Here's what we did:
- Created a form with 3 combo boxes to select the configuration of each system.
- Created a table for each combo box to pull values from
- On the form created a button that runs a Select Case for each combo box. The case determines which configuration to select and changed the source of the Subreport control to the appropriate query.
I've included a sample of the code below in case it helps someone in the future.
Code:
Private Sub Button_CreateReport_Click()
'Check to ensure combo boxes are populated
If IsEmpty(Combo_PC) Or IsNull(Combo_PC) Then
MsgBox "Must select a PC version", vbInformation, "PC version missing"
Combo_PC.SetFocus
ElseIf IsEmpty(Combo_RTR) Or IsNull(Combo_Rtr) Then
MsgBox "Must select a RTR version", vbInformation, "RTR version missing"
Combo_RTR.SetFocus
ElseIf IsEmpty(Combo_PRINTER) Or IsNull(Combo_Printer) Then
MsgBox "Must select an PRINTER version", vbInformation, "PRINTER version missing"
Combo_PRINTER.SetFocus
Else:
DoCmd.OpenReport "CombinedReport", acViewReport
Select Case Combo_PC
Case "1"
Report_CombinedReport.PCDocSub.SourceObject = "PCDocReport"
Report_PCDocReport.RecordSource = "PC3DocQuery"
Report_CombinedReport.PCSwSub.SourceObject = "PCSwReport"
Report_PCSWReport.RecordSource = "PC3SwQuery"
Case "2"
Report_CombinedReport.PCDocSub.SourceObject = "PCDocReport"
Report_PCDocReport.RecordSource = "PC4DocQuery"
Report_CombinedReport.PCSwSub.SourceObject = "PCSwReport"
Report_PCSWReport.RecordSource = "PC4SwQuery"
Case "3"
Report_CombinedReport.PCDocSub.SourceObject = "PCDocReport"
Report_PCDocReport.RecordSource = "PC5DocQuery"
Report_CombinedReport.PCSwSub.SourceObject = "PCSwReport"
Report_PCSWReport.RecordSource = "PC5SwQuery"
End Select