"Obj. doesn't support property or method' error msg. on combobox e

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I am getting the error msg, "Obj. doesn't support property or method'
when trying to run the following code from the 'After Update' Event Procedure
(where 'cycle' is a combobox control on my form whose data source is a field
called 'cycle that is set to 'Number' in the table):

Private Sub cycle_AfterUpdate()
Dim cycle As Integer
If Me!cycle = 1 Then
Me!fu_date1.Enabled = True
Me!fu_sbp1.Enabled = True
Else
Me!fu_date1.Enabled = False
Me!fu_sbp1.Enabled = False
End If
End Sub

Is the error message saying that combobox controls can't use the 'Enabled.'
property? Is there a way to disable controls based on a value entered into a
combobox?

Thanks,
 
Hi Pat

I think you are confusing things by declaring a local variable named
"cycle", which is not being used.
Delete the Dim cycle... line and it should be OK.

It's also possible that Access is confusing your "cycle" combo box with the
form's "Cycle" property. Something else to try would be renaming the combo
box to "cboCycle" or some such.

Also, you can simplify this to two lines:
Me!fu_date1.Enabled = (Me!cycle = 1)
Me!fu_sbp1.Enabled = (Me!cycle = 1)
 
Back
Top