D
Duck
I have a form on which I want the rowsource of a combo box to change
dependant on the status of a check box...so that if the check box is
checked the combo box gets its values from one table, and if not from
another table. Seems like it should be a simple matter but I keep
getting an "Object Required" error. I have the following code tied to
the GotFocus event of the combo box:
Private Sub cmbFocal_GotFocus()
On Error GoTo Err_cmbFocal_GotFocus
If chk.Prog = True Then
cmbFocal.RowSourceType = "Table/Query"
cmbFocal.RowSource = "SELECT tblLensProgressive.Type FROM
tblLensProgressive"
Else
cmbFocal.RowSourceType = "Table/Query"
cmbFocal.RowSource = "SELECT tblLensFocal.Focal FROM
tblLensFocal"
End If
Exit_cmbFocal_GotFocus:
Exit Sub
Err_cmbFocal_GotFocus:
MsgBox Err.Description
GoTo Exit_cmbFocal_GotFocus
End Sub
dependant on the status of a check box...so that if the check box is
checked the combo box gets its values from one table, and if not from
another table. Seems like it should be a simple matter but I keep
getting an "Object Required" error. I have the following code tied to
the GotFocus event of the combo box:
Private Sub cmbFocal_GotFocus()
On Error GoTo Err_cmbFocal_GotFocus
If chk.Prog = True Then
cmbFocal.RowSourceType = "Table/Query"
cmbFocal.RowSource = "SELECT tblLensProgressive.Type FROM
tblLensProgressive"
Else
cmbFocal.RowSourceType = "Table/Query"
cmbFocal.RowSource = "SELECT tblLensFocal.Focal FROM
tblLensFocal"
End If
Exit_cmbFocal_GotFocus:
Exit Sub
Err_cmbFocal_GotFocus:
MsgBox Err.Description
GoTo Exit_cmbFocal_GotFocus
End Sub