Solved

Access Form on close event - Fail

Posted on 2014-04-22
3
545 Views
Last Modified: 2014-04-22
Hello All,

I am using a form to enter new records in a table. I have been getting errors when i wanted to do this. When I add a new record to this table, i want a routine to run.

The routine basically saves the value of myCode of that new row (to a variable) that was just added via that form.

''Private Sub Form_AfterUpdate()
'''c = (Trim(Me.myCode))
''Stop
''End Sub

Open in new window

accessformIssue.png
0
Comment
Question by:Rayne
  • 2
3 Comments
 

Author Comment

by:Rayne
ID: 40014442
how do i grab that field value after i added a new row ? via the form
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40014507
Your error indicates you're trying to do something in the BeforeUPdate event that is stopping the process from completing. The BU event should not be used to alter data on the form. You should use it for things like validation or confirmation.

You should be able to run a routine in the BU event assuming it does not alter data on the form.

how do i grab that field value after i added a new row ? via the form
You already asked that here: http://www.experts-exchange.com/Database/MS_Access/Q_28417335.html
0
 

Author Closing Comment

by:Rayne
ID: 40014537
thank you Scott
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now