Link to home
Start Free TrialLog in
Avatar of andyb7901
andyb7901

asked on

Ms Access - After Update function on drop down

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?

Avatar of mbizup
mbizup
Flag of Kazakhstan image

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".
Avatar of andyb7901
andyb7901

ASKER

Everything looks ok with the text box? I even created a brand new one to see if anything helped, but still same problems?
<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?
Its not bound to any table? I am using no table?
instead of using

 text1.setfocus
 text1.Text = ""

try just using

     me.text1=""
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Ah ha ... a new Icon - I read about that in the Newsletter. Kind of silly - why not REAL pix ?

mx
That would be nice, eh?
Kind of a NO Brainer !!  Your new icon looks like you have a leisure suit on, lol !

mx