2115

M

martin

I have the following code set on the OnClick event of a
checkbox;

Private Sub ATTENDINGYES_Click()
SITE_REQUEST.SetFocus
If (Me.ATTENDINGYES = True) Then Me.SITE_REQUEST.Text
= "BEAUDRY"
End Sub

But I keep getting this error;

"2115: The macro or function set to the BeforeUpdate or
ValidationRule property for this field is preventing
Training database from saving the data in the field."

I doesn't appear that I have anything on my BeforeUpdate
even or ValidationRule, Is there anything else I'm missing?
 
D

Dirk Goldgar

martin said:
I have the following code set on the OnClick event of a
checkbox;

Private Sub ATTENDINGYES_Click()
SITE_REQUEST.SetFocus
If (Me.ATTENDINGYES = True) Then Me.SITE_REQUEST.Text
= "BEAUDRY"
End Sub

But I keep getting this error;

"2115: The macro or function set to the BeforeUpdate or
ValidationRule property for this field is preventing
Training database from saving the data in the field."

I doesn't appear that I have anything on my BeforeUpdate
even or ValidationRule, Is there anything else I'm missing?

I haven't tested it, but I don't think you should try to send the focus
away to another control while the check box is still in the process of
being updated. Besides, you don't need to move the focus if you set the
Value property of Me.SITE_REQUEST instead of the Text property. I'd use
the AfterUpdate event of the check box instead of the Click event --
though the Click event should work -- and I'd write it like this:

Private Sub ATTENDINGYES_AfterUpdate()

If (Me.ATTENDINGYES = True) Then
Me.SITE_REQUEST = "BEAUDRY"
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top