Solved

Ms Access - After Update function on drop down

Posted on 2008-10-03
10
606 Views
Last Modified: 2013-11-28
hi,
I have a simple piece of code which clears my text field after I update my drop down box. Simply;
text1.setfocus
text1.Text = ""
This looks to run ok, but when the function hits "End" I get the following error;
"This macro or function set to the BeforeUpdate or ValidationRule preporty for this field is preventing Microsoft Access from saving the data in the field"

Any help?

0
Comment
Question by:andyb7901
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 22633951
Check the design of underlying table, looking at the properties of the field that Text1 is bound to.

Is sounds like you have set the Allow Zero Length property to "no".
0
 

Author Comment

by:andyb7901
ID: 22634148
Everything looks ok with the text box? I even created a brand new one to see if anything helped, but still same problems?
0
 
LVL 61

Expert Comment

by:mbizup
ID: 22634335
<Everything looks ok with the text box?>

Did you check the actual field properties (not the textbox properties) in the table itself, per my previous post?
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:andyb7901
ID: 22634380
Its not bound to any table? I am using no table?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22635187
instead of using

 text1.setfocus
 text1.Text = ""

try just using

     me.text1=""
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 22635866
"This macro or function set to the BeforeUpdate "

Are you SURE you have this code in the *AfterUpdate()* event ??? That error typically occurs when you try to change a value in the Before Update event (which you cannot) ... and this error message implies!

Also, I highly recommend (in the AfterUpdate or elsewhere) you use:

 text1.setfocus
 text1.Text = Null

to avoid any issue with Zero Length String property set to No (as mbizup mentioned) - which it *should* be.

mx
0
 
LVL 61

Expert Comment

by:mbizup
ID: 22636987
andyb7901,

Can we see a sample of this database?  Leave out any personal or otherwise sensitive data.  

It's entirely possible that there is code in another event or some property setting that has not been mentioned here causing this issue.
0
 
LVL 75
ID: 22637981
Ah ha ... a new Icon - I read about that in the Newsletter. Kind of silly - why not REAL pix ?

mx
0
 
LVL 61

Expert Comment

by:mbizup
ID: 22637998
That would be nice, eh?
0
 
LVL 75
ID: 22638014
Kind of a NO Brainer !!  Your new icon looks like you have a leisure suit on, lol !

mx
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question