Re: Lost Record after data entry

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Steve Schapel (schapel_at_mvps.org.ns)
Date: 07/23/04


Date: Fri, 23 Jul 2004 20:36:55 +1200

Mark,

It is more likely, I think, that the new record is being discarded
because, for example, a required field is left blank, or a validation
rule is violated. In any case, there is a better way to achieve your
purpose...
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenReport strDocName, acViewNormal, , strWhere

-- 
Steve Schapel, Microsoft Access MVP
Mark S wrote:
> On a data entry form I have a Print but that basically performs the
> following:
>     DoCmd.Close 
>     DoCmd.OpenReport strDocName, acViewNormal, , strWhere 
>     DoCmd.OpenForm "frmMTAG", acNormal, , strWhere 
> strWhere is from a unique autonumber field on the form.
> I thought I was using the Close to make sure the record was stored,
> then printed it, then reopened it.  This works fine most of the time.
> Occassianally, the record is completely lost.  You can see that the
> autonum field has incremented when you create the next record, but the
> lost record is nowhere in the table.
> 
> I am guessing the OpenReport is occuring before the Close completely
> stores the record.
> 
> Any suggestions?


Relevant Pages

  • Lost Record after data entry
    ... On a data entry form I have a Print but that basically performs the ... strWhere is from a unique autonumber field on the form. ... lost record is nowhere in the table. ...
    (microsoft.public.access.formscoding)
  • Re: Lost Record after data entry
    ... This bug has been present since at least version 2 of Access, ... DoCmd.OpenReport strDocName, acViewNormal,, strWhere ... > strWhere is from a unique autonumber field on the form. ... > lost record is nowhere in the table. ...
    (microsoft.public.access.formscoding)