Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 26th, 2008, 02:08 PM
Authorized User
 
Join Date: Jan 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to undo changes to my subform?

i'm using a form with a subform to retrieve records that i want to either update or add new. i'm using the subform to list the pertaining records associated with a project and i want to be able to edit those records inside the subform. i currently have a cancel button on my main form to undo any changes but that doesnt work on my subform is there a procedure or something that i can do to undo my changes in the subform from the main form. i'm currently using a cancel button with this procedure:

    If (Me.Dirty = True) Then
        Me.Undo
    End If
    DoCmd.Close acForm, Me.Name

 
Old September 29th, 2008, 01:31 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Refering to sub form controls is dicey. Is there a reason to do data entry in a sub form? It sounds like it is a data sheet sub form, which makes it even more difficult.

The problem with referring to sub form controls is naming them properly, then taking the Control.OldValue and replacing the new Value without replacing it in every other control on the sub form.

I would consider a design change. What does the sub form look like?


mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old October 1st, 2008, 11:30 AM
Authorized User
 
Join Date: Jan 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The subform displays columns (datasheet view). unfortunately i'm creating tables from data that is 30 years old or older and working with current data so i dont have the luxury of starting fresh with new data so i have to conform to the way the records were kept. in my line of work its possible to have multiple "recording numbers" per one project number so i created a table that allows you to enter a record for each recording number so that means there could be multiple project numbers assigned to different "recording numbers" inside of the table. so my attempt is to enter the project number and have it retreive all the associated "recording numbers" with the project so they can be edited in the event of a data entry error or if there is an update to the recording number.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i write code to go back or undo sanderson Beginning VB 6 1 July 9th, 2008 05:10 PM
How to Undo SHFileOperation action from VB code? vb_programmer Pro VB 6 0 July 15th, 2006 02:51 AM
how to undo the multiple record ??? elleetan Access 6 April 20th, 2004 04:14 AM
My UNDO wont UNDO socoolbrewster Access 2 March 22nd, 2004 08:36 PM
Undo string on graphics Dinesh22 VB.NET 2002/2003 Basics 2 January 27th, 2004 12:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.