Code in subform triggers Active X Error

cstanley

Registered User.
Local time
Today, 00:44
Joined
May 20, 2002
Messages
86
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
 
Chris,

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

Wayne
 
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
 
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:

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

Wayne
 
Thanks, but I'm still getting the same error... any suggestions?

Chris
 

Users who are viewing this thread

Back
Top Bottom