×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

runtime error 2115

runtime error 2115

runtime error 2115

(OP)
I have an access database that I have various check boxes and text boxes on.  I want to be able to use the AfterUpdate event when a checkbox is checked to assign text data to a text box.  Both are linked to the database of course.  When I code it and try to perform the function I get the Run-Time Error 2115, which states the macro or validation rule is not allowing the databaes to be updated.  I have no macro or validation rule.  My code is below..

Private Sub chkdti_AfterUpdate()
If chkdti.Value Then
Me.txtenvdti.SetFocus
Me.txtenvdti.Text = "X"
Me.chkdti.SetFocus
Else
Me.txtenvdti.SetFocus
Me.txtenvdti.Text = ""
Me.chkdti.SetFocus
End If
End Sub

RE: runtime error 2115

Does the field definition for envdti allow zero length strings?

RE: runtime error 2115

Hi

line

Me.txtenvdti.Text = ""

perhaps it is set to allow zero length no

try (as a check)

Me.txtenvdti.Text = " "

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - www.kenneth.reay.btinternet.co.uk
UK

RE: runtime error 2115

(OP)
yes, it's set to allow zero length strings.

RE: runtime error 2115

Hi!

What line is giving you the error?

A couple of things to note, instead of the .SetFocus and .Text use the .Value:

Private Sub chkdti_AfterUpdate()
If chkdti.Value Then
Me.txtenvdti.Value = "X"
Else
Me.txtenvdti.Value = ""
End If
End Sub

Your field in the table that txtenvdti is linked to may be set to not allow zero length strings. You can check this in the design view of the table. If it is set to no, then you can change the value to Yes. Alternatively you can use:

Me.txtenvdti.Value = Null

instead of:

Me.txtenvdti.Value = ""

hth

Jeff Bridgham
Purdue University
Graduate School
Data Analyst

RE: runtime error 2115

(OP)
Bingo!  thank you!  using the .value instead of .text worked like a charm..

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close