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
Solved

Access Form on close event - Fail

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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: …

856 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