473,378 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to solve the "runtime error 2115"

Hi, I have a database-form with a couple of text boxes in it.
I want to replace the first letter that is written in a
text box with an uppercase letter, so I use the "after update" event and have written the following code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub straatenhuisnummer_AfterUpdate()
  2. dim anaam as string
  3. anaam = Forms!medewerker!straatenhuisnummer.Text
  4. anaam = UCase(Left(anaam, 1))
  5. Forms!medewerker!straatenhuisnummer.Text = anaam
  6. End Sub
  7.  
When the code is performed, I get the following
error, which states "the macro or function set to the beforeupdate or validationrule property for this field is preventing Microsoft Access from saving the data in this field".
Can anyone help me with this? thanks!
Mar 8 '12 #1
1 6829
NeoPa
32,556 Expert Mod 16PB
You are updating the control in the control's own AfterUpdate event procedure. That doesn't make much sense does it ;-)

Try using BeforeUpdate instead :
Expand|Select|Wrap|Line Numbers
  1. Private Sub straatenhuisnummer_BeforeUpdate(Cancel As ...)
  2.     With Me
  3.         .straatenhuisnummer = Mixcase(.straatenhuisnummer)
  4.     End With
  5. End Sub
Also, please don't post code you've typed in directly in future. It wastes our time and isn't greatly appreciated. See Before Posting (VBA or SQL) Code.
Mar 8 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: MLH | last post by:
I'm thinking that maybe error trapping code could be in a global module (standard procedure) and a Master "OnError" statement could be set. Is anything like this in use with VBA for A97?
20
by: DraguVaso | last post by:
Hi, As a former VB-programmer I'm used to the "on error goto"-errorhandling. I see that in actually all the VB.NET-samples I can fin people use the "Try - catch"-errorhandling. Which of the...
0
by: multisync | last post by:
I'm getting the following error: Unknown error (0x80005000) It gives this error on the line "results = searcher.FindAll()" -----code------ Dim rootentry As New...
3
by: John Nagle | last post by:
I'm getting a wierd error from urllib2 when opening certain URLs. The code works for most sites, but not all of them. Here's the traceback: InfoSitePage EXCEPTION while processing page...
1
by: Chris Sharrard | last post by:
Hello All, I have been trying to fix the following problem; this bit of code works fine when it is compiled as part of a Windows application but when I move it out to a DLL I get the debug error -...
1
by: technod | last post by:
Hi, The error I am describing occurs with the script I've pasted below. It's a validator for form fields and prints a message into a span tag located beside the empty input tag. I have hard...
0
by: syedsarfaraz | last post by:
Hi There! Could anybody please help regarding the below issue. We had a COM+ component deployed on Windows 2000/NT machine it was working fine, I mean when it was being invoked from other...
1
by: brboga | last post by:
Hello, VBA gives an error on the indicated line. "tblparameters" is a database which exists. Option Compare Database Option Explicit Sub fill_parameters()
0
by: CoreyReynolds | last post by:
Hey all, I have a piece of code that dumps a bunch of data into a spreadsheet. Also rearranges it into a pivot table and then graphs the pivot table as well so my boss can get a clear view of the...
4
by: shalskedar | last post by:
In my DB(Ms Access 2003)I want to delete a record from 1 table which is linked to another table. For ex- There are 2 tables "MasterType" which is the Master table & another table as "Sash DO"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.