Solved

Access Form on close event - Fail

Posted on 2014-04-22
3
549 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

Backup Your Microsoft Windows Server®

Backup 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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article will show you how to use shortcut menus in the Access run-time environment.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

914 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

21 Experts available now in Live!

Get 1:1 Help Now