1

Topic: Error 29068

There was a following problem.
The task. The initial database undertakes, contents of tables by certain rules are corrected. Forms are interposed, the macro autoexec and turns out basis under the specific customer. All worked normally. But it was necessary to complicate a little the task on basis formation. To hang up branching code. And the program began to take off by mistake of 29068 (look application)
The error arises in a following fragment of the code

strPath = DLookup ("Path", "tblPath", "NikName ='RabPath '") ' CurrentProject. Path
DestinationDatabase = fnBuildPath (strPath, "ONS_T.mdb")
NewName = "frmAlarm"
SourceObjectName = "frmAlarm"
DoCmd. CopyObject DestinationDatabase, NewName, acForm, SourceObjectName
NewName = "autoexec"
SourceObjectName = "autoexec _"
DoCmd. CopyObject DestinationDatabase, NewName, acMacro, SourceObjectName

the Error arises after the second operator DoCmd. CopyObject Sometimes it does not arise (especially after basis compression). If you transit under a debugger never happens. Probably previous operator not always has time to fulfill. What to do? Tried to put Sleep , did not help.
-------------------------------------------------------------
And you enclosed already the blood rouble in Bill Gates's 50 milliard state?

2

Re: Error 29068

DoEvents?

3

Re: Error 29068

Joss, and if at first a macro, and then the form?

4

Re: Error 29068

Joss wrote:

the Error arises after the second operator DoCmd. CopyObject

AT its performance or AFTER its performance, on the following operator?

Joss wrote:

Sometimes it does not arise (especially after basis compression)

Compression of which basis - in which code (most possibly) or in which copying is fulfilled?
Generally I would interpose in front of the second unit of copying small (100-200 msec) a time delay.

5

Re: Error 29068

The first, DoEvents put - did not help.
Time delay put - did not help (sleep 1000)
Places copying of the form and a macro did not change.
While made following

Public Sub sbCopyFormAlarm ()
On Error GoTo sbCopyFormAlarm_Error
...
...
Exit_sbCopyFormAlarm:
On Error GoTo 0
Exit Sub
sbCopyFormAlarm_Error:
If Err = 29068 Then
DoEvents
Resume
Else
MsgBox "Error" AND Err. Number AND "("AND Err. Description AND") in procedure sbCopyFormAlarm of Module Module1"
Resume Exit_sbCopyFormAlarm
End If
End Sub

While an error did not produce. I am simple  handling of this error. It will not be fulfilled yet - will try.

6

Re: Error 29068

Joss wrote:

I am simple  handling of this error. It will not be fulfilled yet - will try.

So - it is bad.
1) Enter a variable-counter, and restrict the maximum quantity of "coils" of a cycle;
2) the Handler include directly ahead of the operator, and ungear right after it.

7

Re: Error 29068

Akina wrote:

it is passed...
So - it is bad.
1) Enter a variable-counter, and restrict the maximum quantity of "coils" of a cycle;
2) the Handler include directly ahead of the operator, and ungear right after it.

It makes sense. Only instead of a cycle timer it is better to supervise probably time - 5-10  Though here you will not guess that it is better.

8

Re: Error 29068

Joss wrote:

instead of a cycle timer it is better to supervise probably time

Nothing hinders to supervise both that, and it:

counter = 10
start = timer
On Error GoTo sbCopyFormAlarm_Error
DoCmd. CopyObject
sbCopyFormAlarm_Error:
If Err = 29068 Then
counter = counter - 1
if counter = 0 or timer - start> 10 then Resume Exit_sbCopyFormAlarm
DoEvents
Resume

9

Re: Error 29068

Akina wrote:

Nothing hinders to supervise both that, and it

And I will make