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]
>>> .
>>>
>
>
|