Repost: Will not save until ESC or Undo

N

Nick X

Hi All, (Sorry for the repost, but it is urgent)
I created an application starting with the Time and Billing template.
Originally I had the data going into SharePoint but SP could not handle the
data (local rules). Now the back-end is in SQL Server 2005, but I digress.
The problem seems to be in the forms. When I create a new record in the
Project List form (Split form with datasheet showing) i must move to the next
field and hit escape or undo before the record saves. It is also now doing
this in my details form (Single Form). I went through the steps for fixing
corruption, including creating a new database shell and importing all of my
objects. Does anyone have a suggestion?
 
A

Arvin Meyer [MVP]

Bound records are not saved until the data moves to the next record. If you
want to save them sooner, you must do it manually.

Try using:

DoCmd.RunCommand acCmdSaveRecord

or

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

both of which will save your record.
 
N

NickX

When I create a new record in the Project List form (Split form with datasheet showing) i must move to the next field and hit escape or undo before the record saves.  It is also now doing this in my details form (Single Form).

Sorry, I didn't give you my complete thought there. Access will not
allow me to tab out of the record or click out of the record (which is
where Access would commit the changes and save, correct?). Once I
reach the last field in the record, the cursor will not move to the
next record. This is an ODBC database with SQL Server 2005 on the
back-end. When I make a change, I click or tab into the next field
and then I can hit ESC or Undo and the record is then saved (the
"Edit" pencil disappears from the record selector).
Up until now this has been only an annoyance because of the low volume
of users. But today I am training the IT staff how to use the app to
track their Projects and Time. We all know how tough IT folks can be
on even the smallest detail.

Thanks for your time,
Nick
 
N

NickX

....and technically when I undo or hit ESC the record should go away,
but it saves instead and clears the undo history (can't undo). things
that make you go hmmmmmmmmmmmm!?
 
A

Arvin Meyer [MVP]

NickX said:
...and technically when I undo or hit ESC the record should go away,
but it saves instead and clears the undo history (can't undo). things
that make you go hmmmmmmmmmmmm!?

In order to Undo or Esc from the entire record, you need to do it twice.
Hitting ESC just once, undoes the last field.

Do you have any required fields? I'm thinking that not being able to save
may be because of that. Did you try the code I offered in my first post?
 
N

NickX

Arvin,
Thanks for your help. I found the culprit:

Private Sub Form_AfterUpdate()

ModifiedByGroup = [Forms]![frmIdentity]![Division_Group]
Modified = Format(Now())
ModifiedBy = fOSUserName()

End Sub

Apparently it does not like the "ModifiedByGroup" portion of the
code. What would be an appropriate alternative to update this value?

Thanks,
Nick
 
N

NickX

Arvin,
Thanks for your help.  I found the culprit:

Private Sub Form_AfterUpdate()

    ModifiedByGroup = [Forms]![frmIdentity]![Division_Group]
    Modified = Format(Now())
    ModifiedBy = fOSUserName()

End Sub

Apparently it does not like the "ModifiedByGroup" portion of the
code.  What would be an appropriate alternative to update this value?

Thanks,
Nick

(BeforeUpdate seems to work)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top