S
Sharon
I have FINALLY gotten the option group feature to work on this subform. When
I select the ReportType in the option group, the correct report numbers show
in the combobox. However, when I return to this record, the report number is
correct, but the option group button is not selected. Below is the code:
Private Sub grpReportNumber_AfterUpdate()
Dim strSQL As String
'clear the combo box
cboReportNumber.Value = Null
Select Case grpReportNumber
Case 1
strSQL = "SELECT tblExpenseReport.ExpenseReportNumber " & _
"FROM tblExpenseReport " & _
"Order By ExpenseReportNumber; "
Case 2
strSQL = "SELECT tblTravelExpenseReport.TravelExpenseReportNumber " & _
"FROM tblTravelExpenseReport " & _
"Order By TravelExpenseReportNumber;"
Case 3
strSQL = "SELECT tblCheckRequest.CheckRequestNum " & _
"FROM tblCheckRequest " & _
"Order By CheckRequestNum;"
Case 4
strSQL = "SELECT tblPurchaseOrder.PurchaseOrderNum " & _
" FROM tblPurchaseOrder " & _
"Order By PurchaseOrderNum;"
End Select
Me.cboReportNumber.RowSource = strSQL
Me.cboReportNumber.SetFocus
Me.cboReportNumber.Dropdown
End Sub
Any help is appreciated. Thanks.
I select the ReportType in the option group, the correct report numbers show
in the combobox. However, when I return to this record, the report number is
correct, but the option group button is not selected. Below is the code:
Private Sub grpReportNumber_AfterUpdate()
Dim strSQL As String
'clear the combo box
cboReportNumber.Value = Null
Select Case grpReportNumber
Case 1
strSQL = "SELECT tblExpenseReport.ExpenseReportNumber " & _
"FROM tblExpenseReport " & _
"Order By ExpenseReportNumber; "
Case 2
strSQL = "SELECT tblTravelExpenseReport.TravelExpenseReportNumber " & _
"FROM tblTravelExpenseReport " & _
"Order By TravelExpenseReportNumber;"
Case 3
strSQL = "SELECT tblCheckRequest.CheckRequestNum " & _
"FROM tblCheckRequest " & _
"Order By CheckRequestNum;"
Case 4
strSQL = "SELECT tblPurchaseOrder.PurchaseOrderNum " & _
" FROM tblPurchaseOrder " & _
"Order By PurchaseOrderNum;"
End Select
Me.cboReportNumber.RowSource = strSQL
Me.cboReportNumber.SetFocus
Me.cboReportNumber.Dropdown
End Sub
Any help is appreciated. Thanks.