PC Review


Reply
Thread Tools Rate Thread

Commit/Save Record

 
 
Manuel
Guest
Posts: n/a
 
      13th Apr 2010
I have a form where users enter data. Once the record is edited a picture of
a pencil appears to indicate that the record has been edited. I want to
commit the record to the database/save the record immediately after the
record is edited. How would I do this?

Thanks,

Manuel

 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      14th Apr 2010
On Tue, 13 Apr 2010 15:26:26 -0700, Manuel <(E-Mail Removed)>
wrote:

>I have a form where users enter data. Once the record is edited a picture of
>a pencil appears to indicate that the record has been edited. I want to
>commit the record to the database/save the record immediately after the
>record is edited. How would I do this?
>
>Thanks,
>
>Manuel


What exactly do you mean? The pencil appears the instant the record is
"dirtied" - at the very first keystroke in any bound field in the form. Do you
want the record to be saved when you type "M" in the firstname field, saved
again when you type "a", yet again when you type "n", and so on? If so, why?

Access will automatically save the record when you *leave* the last field in
the tab order, or move to a new record, or close the form (unless of course it
fails validation); is that not adequate?

--

John W. Vinson [MVP]
 
Reply With Quote
 
Manuel
Guest
Posts: n/a
 
      14th Apr 2010
I have a command button that runs a report and if the user makes a change and
then runs the report immediately afterwards, the change in not captured in
the report. I guess I should have asked how to refresh/requery the report 's
recordset (if that's even the most appropriate course of action).

Thanks for your assistance.

Manuel

"John W. Vinson" wrote:

> On Tue, 13 Apr 2010 15:26:26 -0700, Manuel <(E-Mail Removed)>
> wrote:
>
> >I have a form where users enter data. Once the record is edited a picture of
> >a pencil appears to indicate that the record has been edited. I want to
> >commit the record to the database/save the record immediately after the
> >record is edited. How would I do this?
> >
> >Thanks,
> >
> >Manuel

>
> What exactly do you mean? The pencil appears the instant the record is
> "dirtied" - at the very first keystroke in any bound field in the form. Do you
> want the record to be saved when you type "M" in the firstname field, saved
> again when you type "a", yet again when you type "n", and so on? If so, why?
>
> Access will automatically save the record when you *leave* the last field in
> the tab order, or move to a new record, or close the form (unless of course it
> fails validation); is that not adequate?
>
> --
>
> John W. Vinson [MVP]
> .
>

 
Reply With Quote
 
Jeanette Cunningham
Guest
Posts: n/a
 
      14th Apr 2010
The code for the button that runs the report needs to save the form before
the report runs.
So the first line of code for the button should be

If Me.Dirty = True Then
Me.Dirty = False
End If


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Manuel" <(E-Mail Removed)> wrote in message
news:87D47C9D-9A85-485F-9C86-(E-Mail Removed)...
>I have a command button that runs a report and if the user makes a change
>and
> then runs the report immediately afterwards, the change in not captured in
> the report. I guess I should have asked how to refresh/requery the report
> 's
> recordset (if that's even the most appropriate course of action).
>
> Thanks for your assistance.
>
> Manuel
>
> "John W. Vinson" wrote:
>
>> On Tue, 13 Apr 2010 15:26:26 -0700, Manuel
>> <(E-Mail Removed)>
>> wrote:
>>
>> >I have a form where users enter data. Once the record is edited a
>> >picture of
>> >a pencil appears to indicate that the record has been edited. I want to
>> >commit the record to the database/save the record immediately after the
>> >record is edited. How would I do this?
>> >
>> >Thanks,
>> >
>> >Manuel

>>
>> What exactly do you mean? The pencil appears the instant the record is
>> "dirtied" - at the very first keystroke in any bound field in the form.
>> Do you
>> want the record to be saved when you type "M" in the firstname field,
>> saved
>> again when you type "a", yet again when you type "n", and so on? If so,
>> why?
>>
>> Access will automatically save the record when you *leave* the last field
>> in
>> the tab order, or move to a new record, or close the form (unless of
>> course it
>> fails validation); is that not adequate?
>>
>> --
>>
>> John W. Vinson [MVP]
>> .
>>



 
Reply With Quote
 
Jeanette Cunningham
Guest
Posts: n/a
 
      16th Apr 2010
I always test first to see if it's needed, to stop any before update
validation code running. Why make access go to the trouble of saving if
there's nothing to save?

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




"jay" <(E-Mail Removed)> wrote in message
news:7B50E4E64A15459899A7EB69C374564E@JayPC...
> Curious why you need the If statement. Why wouldn't you just put
> Me.dirty = False and force a save in any event.
>
> -----Original Message-----
> From: Jeanette Cunningham [private.php?do=newpm&u=]
> Posted At: Tuesday, April 13, 2010 6:32 PM
> Posted To: microsoft.public.access.modulesdaovba
> Conversation: Commit/Save Record
> Subject: Re: Commit/Save Record
>
>
> The code for the button that runs the report needs to save the form
> before the report runs.
> So the first line of code for the button should be
>
> If Me.Dirty = True Then
> Me.Dirty = False
> End If
>
>
> Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
>
>
> "Manuel" <(E-Mail Removed)> wrote in message
> news:87D47C9D-9A85-485F-9C86-(E-Mail Removed)...
>>I have a command button that runs a report and if the user makes a
>>change and then runs the report immediately afterwards, the change in
>>not captured in the report. I guess I should have asked how to
>>refresh/requery the report 's recordset (if that's even the most
>>appropriate course of action).
>>
>> Thanks for your assistance.
>>
>> Manuel
>>
>> "John W. Vinson" wrote:
>>
>>> On Tue, 13 Apr 2010 15:26:26 -0700, Manuel
>>> <(E-Mail Removed)>
>>> wrote:
>>>
>>> >I have a form where users enter data. Once the record is edited a
>>> >picture of a pencil appears to indicate that the record has been
>>> >edited. I want to commit the record to the database/save the record

>
>>> >immediately after the record is edited. How would I do this?
>>> >
>>> >Thanks,
>>> >
>>> >Manuel
>>>
>>> What exactly do you mean? The pencil appears the instant the record
>>> is "dirtied" - at the very first keystroke in any bound field in the

> form.
>>> Do you
>>> want the record to be saved when you type "M" in the firstname field,

>
>>> saved again when you type "a", yet again when you type "n", and so
>>> on? If so, why?
>>>
>>> Access will automatically save the record when you *leave* the last
>>> field in the tab order, or move to a new record, or close the form
>>> (unless of course it fails validation); is that not adequate?
>>>
>>> --
>>>
>>> John W. Vinson [MVP]
>>> .
>>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need a line of code to commit the new record to the table Joe Clark Microsoft Access Form Coding 3 17th Mar 2007 01:40 AM
Auto save and commit of an inverse record =?Utf-8?B?UmljaGFyZA==?= Microsoft Access VBA Modules 4 7th Aug 2006 03:57 PM
Save works but does not COMMIT =?Utf-8?B?QWNjZXNzVGVzdGVyMQ==?= Microsoft Access Forms 3 8th Aug 2005 05:42 PM
Record Limit for Using Transactions, Commit? =?Utf-8?B?QnJpYW4=?= Microsoft Access Queries 1 8th Dec 2004 01:58 AM
Force continuous from to commit/save record Alex Microsoft Access Forms 0 29th Jul 2003 12:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:42 PM.