?
Solved

Access Form on close event - Fail

Posted on 2014-04-22
3
Medium Priority
?
567 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
[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
  • 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
New style of hardware planning for Microsoft Exchange server.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

777 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