Option Group

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.
 
T

Tom Lake

Sharon said:
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:

Is the Option Group bound to a field in the underlying table?

Tom Lake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top