Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Ms Access - After Update function on drop down

Posted on 2008-10-03
10
Medium Priority
?
609 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

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 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

670 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