Randall Anthony
ranthony at wrsystems.com
Wed Jan 28 13:40:46 CST 2004
Whew... Took a while to find it, and at first glance it has nothing to do
with your problem, but it may give you some ideas:
Dim rst as DAO.recordset
Set rst = CurrentDb.OpenRecordset("Customers",dbOpenDynaset,DbSeeChanges)
Rst.FindFirst "[Country] = 'Mexico'"
Do Until rst.NoMatch
Rst.Delete
Rst.FindNext "[Country] = 'Mexico'"
Loop
by design, when using the dbSeeChanges constant (in a Microsoft Jet
workspace) JET will trap changes while two or more users (and/or methods)
are editing or deleting the same record. Thereby, in your case when using
dbSeeChanges you are able to see the result of the record deleted.
(note: we tested this on local tables in your database application in both
versions of Access: 97 and 2000)
RESOLUTION/Workaround:
You modified your code to
Do Until rst.EOF
rst.Delete
rst.MoveNext
Loop
This eliminates the need of forcing JET to repoll the database as it was
doing in your original code.
-----Original Message-----
From: Rocky Smolin - Beach Access Software [mailto:bchacc at san.rr.com]
Sent: Wednesday, January 28, 2004 2:17 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Error 2468 - You can't carry out this action at
thepresent time.
Randall:
I think it doesn't have to do with the DAO recordset because the problem
with two deletes in a row doesn't mess with that.
Rocky
----- Original Message -----
From: "Randall Anthony" <ranthony at wrsystems.com>
To: "'Access Developers discussion and problem solving'"
<accessd at databaseadvisors.com>
Sent: Wednesday, January 28, 2004 10:31 AM
Subject: RE: [AccessD] Error 2468 - You can't carry out this action at the
present time.
> Right off the top of my head, it has to do with the movefirst, movelast.
I
> ran into this when converting A97 to A2K. Code worked in A97, not A2K and
> M$ said this was designed behavior. I'll try to find the article.
>
> -----Original Message-----
> From: Rocky Smolin - Beach Access Software [mailto:bchacc at san.rr.com]
> Sent: Wednesday, January 28, 2004 1:07 PM
> To: AccessD at databaseadvisors.com
> Subject: [AccessD] Error 2468 - You can't carry out this action at the
> present time.
>
> Dear List:
>
> I am getting the following error message on a bound form:
>
> Error 2468 - You can't carry out this action at the present time.
>
> This form has a sub form linked to the main form by the main form's
primary
> key. (Main form is P.O. Header, subform is P.O. Detail).
>
> I get this error if I try to delete two records in a row.
>
> DoCmd.SetWarnings False
> DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
> DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
> DoCmd.SetWarnings True
>
> I also get this error after I try to add a record. The problem started
> because I wanted to get the last PO in the file, add one to the PO number,
> and put the prefix and the new PO number ito the new record:
>
> DoCmd.GoToRecord , , acNewRec
>
> 'If rstPOHeader.RecordCount <> 0 Then
> ' rstPOHeader.MoveLast
> ' Me.fldPOPrefix = Nz(rstPOHeader!fldPOPrefix)
> ' If IsNumeric(rstPOHeader!fldPONumber) Then
> ' Me.fldPONumber = rstPOHeader!fldPONumber + 1
> ' fldPOOrderDate.SetFocus
> ' Else
> ' Me.fldPONumber.SetFocus
> ' End If
> 'End If
> 'If Nz(Me.fldPOPrefix) = "" And Nz(rstPOHeader!fldPOPrefix) = "" Then
_
> Me.fldPOPrefix.SetFocus
>
> Right now the code is commented out. If I uncomment the two lines:
>
> ' rstPOHeader.MoveLast
> ' Me.fldPOPrefix = Nz(rstPOHeader!fldPOPrefix)
>
> I get the error when I try to save:
>
> DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
>
> I checked the web and there is nothing. Has anyone encountered this
before?
>
> Thanks and regards,
>
> Rocky Smolin
> Beach Access Software
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com