View Full Version : Code in subform triggers Active X Error


cstanley
09-03-2003, 02:45 PM
Hi all,

I have put an If statement into a subform in the AfterUpdate property of a checkbox, telling it to update a combo box field if it is checked. All very simple. However, since it is in the subform, whenever it runs the code, it gives me an Active X error. I've looked through the posts since this is a common problem, but I can't seem to find a solution. I am using Access 2000, and my references are as such:


Visual Basic for Applications
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft DAO Object Library

Any clues?

Thanks!

Chris

WayneRyan
09-03-2003, 02:55 PM
Chris,

I'm using A2000 and I can't replicate the problem.

Wayne

cstanley
09-03-2003, 03:11 PM
I put the code in the module for the subform, not the main form... does this make a difference?

'Private Sub ckQ1_AfterUpdate(Cancel As Integer)
'If Value.ckQ1 = 1 Then
'compcode.Value = "Critical"
'End If

'End Sub

WayneRyan
09-03-2003, 03:24 PM
Chris,

I put the code in the module for the subform, not the main form... does this make a difference?

Its the right place, but "1" is not what you need:


Private Sub ckQ1_AfterUpdate(Cancel As Integer)
If Me.ckQ1 = True Then
Me.compcode = "Critical"
End If
End Sub


Wayne

cstanley
09-08-2003, 07:58 AM
Thanks, but I'm still getting the same error... any suggestions?

Chris