B
Bill Murphy
I have a simple form where all of the fields are unbound. There is one
combo box which is initially populated by the query qryChaseBAIFilesCombo,
and it is properly populated when the form first opens. The form has two
radio buttons which allow the user to change the rowsource of the combo box
as shown in the code below. However, when the user clicks on the second
radio button the combo box and the related text box txtFileName are blank.
The rowsource did change, since I can then drop down the list and see the
results of qryBatchIDForCombosFW, and I can click on an item in the list and
see that the combo and the text box then populate as expected.
Is there any additional code I should add to avoid the blank combo box
problem?
Bill
Private Sub optFiles_AfterUpdate()
If Forms!frmChasePrintSummaryReport!optFiles = 1 Then
Forms!frmChasePrintSummaryReport!cboBatchID.RowSource =
"qryChaseBAIFilesCombo"
Else
Forms!frmChasePrintSummaryReport!cboBatchID.RowSource =
"qryBatchIDForCombosFW"
End If
Forms!frmChasePrintSummaryReport!cboBatchID.Requery
Forms!frmChasePrintSummaryReport!cboBatchID.SetFocus
Forms!frmChasePrintSummaryReport!txtFileName =
Forms!frmChasePrintSummaryReport![cboBatchID].Column(2)
End Sub
combo box which is initially populated by the query qryChaseBAIFilesCombo,
and it is properly populated when the form first opens. The form has two
radio buttons which allow the user to change the rowsource of the combo box
as shown in the code below. However, when the user clicks on the second
radio button the combo box and the related text box txtFileName are blank.
The rowsource did change, since I can then drop down the list and see the
results of qryBatchIDForCombosFW, and I can click on an item in the list and
see that the combo and the text box then populate as expected.
Is there any additional code I should add to avoid the blank combo box
problem?
Bill
Private Sub optFiles_AfterUpdate()
If Forms!frmChasePrintSummaryReport!optFiles = 1 Then
Forms!frmChasePrintSummaryReport!cboBatchID.RowSource =
"qryChaseBAIFilesCombo"
Else
Forms!frmChasePrintSummaryReport!cboBatchID.RowSource =
"qryBatchIDForCombosFW"
End If
Forms!frmChasePrintSummaryReport!cboBatchID.Requery
Forms!frmChasePrintSummaryReport!cboBatchID.SetFocus
Forms!frmChasePrintSummaryReport!txtFileName =
Forms!frmChasePrintSummaryReport![cboBatchID].Column(2)
End Sub