Selasa, 24 November 2015

Re: [MS_AccessPros] Uncommitted records are lost

 

Steve-


We need to see the actual code.  If your code depends on the current record being saved, then you should make sure it is saved with one line like this:

    If Me.Dirty Then Me.Dirty = False

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Nov 24, 2015, at 12:26 PM, Steve thaw5@suddenlink.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

It appears the record is saved to the table if I close the form by right clicking on the form's tab and click on Close.

The code behind the form's Finish button does this:
- Inserts a record into a different table
- Gets the primary key from that newly inserted record (into the different table) and inserts it into a field of the form's table
- Inserts the records in the form's table into a master table
- Deletes all the records in the form's table

Steve

On 11/24/2015 12:39 PM, Bob Peterson bob@alternatefinishing.com [MS_Access_Professionals] wrote:
 

Does the info get saved if you close the form without using your button?

 

What is the code behind your button?

 

Bob Peterson

 

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Tuesday, November 24, 2015 11:43 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Uncommitted records are lost

 



Nothing in the Before Update event. I set some variables in the Form Load event. And have code in the Click event for the command button that closes the form. No other code.

On 11/24/2015 10:26 AM, John Viescas JohnV@msn.com [MS_Access_Professionals] wrote:

 

Steve-

Do you have any code in the form - particularly in the Before Update event?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

On Nov 24, 2015, at 7:03 AM, Steve thaw5@suddenlink.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I have a form whose record source is a table. The user can add and
revise records. If the user adds a record and then closes the form
without navigating away from the newly added record, then the added
record is lost. In a similar fashion, if the user revises an existing
record but does not navigate away from it, that record is lost. Is there
a way in VBA to capture those uncommitted records in the underlying table?

Steve

------------------------------------
Posted by: Steve <thaw5@suddenlink.net>
------------------------------------

------------------------------------

Yahoo Groups Links







__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

.

__,_._,___

Tidak ada komentar:

Posting Komentar