Solved

Access Form on close event - Fail

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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

724 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