Error 2115

BigJimSlade

Registered User.
Local time
Today, 18:27
Joined
Oct 11, 2000
Messages
173
Hey, Big Jim here:

I have read some other messages about this error, but none seem to help me. I am simply trying to click on a check box and have the on click method send set the focus to a text box, change what is in the text box, and then return the focus to the check box. But I get this error 2115 (The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Access from saving the data in the field).

Here is my code:

intCheck = chkMultiple.Value
If intCheck = -1 Then

cboIndexCode.SetFocus
cboIndexCode.Text = "MULT"
F_Build_Num.SetFocus
cboIndexCode.Enabled = False

Else:
cboIndexCode.Enabled = True
cboIndexCode.SetFocus
cboIndexCode.Text = ""
End If

Any thoughts would be appreciated. Thanks in advance!

Big Jim
 
Hey there Big Jim,
I can see why you are having trouble finding help on this. For some reason the Jet Error help file doesn't list it, I cannot use the 'Find' feature in my Access Help right now for some reason, and the MSDN library doesn't even mention it directly. It refers to it indirectly here:

ACC: Commands Not Available During BeforeUpdate Event
ID: Q128195

But, all this refers to code which is run in the Before_Update event of a control. You don't mention where you are running your code but I'll bet it's in the After_Update event of your checkbox.

At any rate, this works:

intCheck = chkMultiple.Value
If intCheck = -1 Then

cboIndexCode.SetFocus
cboIndexCode = "MULT"
F_Build_Num.SetFocus
cboIndexCode.Enabled = False

Else:
cboIndexCode.Enabled = True
cboIndexCode.SetFocus
cboIndexCode = ""
End If

I'd love to be able to understand WHY your code generates the error.
(First need to figure out why Find crashes my Access Help heh)

Shep

[Edit]:
I see after re-reading your post that you do say where you are running your code. No matter...won't work in the After_Update event either. By the way, this is where I would run any code which is triggered by the value of a checkbox.

[This message has been edited by Shep (edited 04-06-2002).]
 
Shep,

You have been a great help! Big Jim was glad to hear from you. Thanks again!


Big Jim
 

Users who are viewing this thread

Back
Top Bottom