Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / April 2007

Tip: Looking for answers? Try searching our database.

increment of field after insert working poorly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bicyclops - 23 Apr 2007 19:00 GMT
Access 03

I have a sales quote form with line item numbers. I have a macro that
increments the item number (using dcount) when a new item is added. It's tied
to the After Insert event of the form.

When the macro runs, it leaves the record unsaved when it's done. If I
attempt to add a SaveRecord line, an error results that tells me I can't use
the BeforeUpdate event (which is maddening, because I'm not using it).

I don't like leaving the record unsaved, because the user my click the save
record button twice.
Rick Brandt - 23 Apr 2007 19:07 GMT
> Access 03
>
[quoted text clipped - 9 lines]
> I don't like leaving the record unsaved, because the user my click
> the save record button twice.

Use BeforeInsert, not AfterInsert.  When you change the record AFTER you
have inserted it then you are re-dirtying it.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.