Form Closing on its own

M

Mark A. Sam

Hello,

In the code snippet below a form called "Action Message" is open. During
the execution the form closes for no apparent reason. I had been running
the code all day without a problem.

Note there is condition to Stop execution at the beginning and end of the
snippet. It stops at the second one.

I can't see anything to cause this to happen. This is A2k running on
Windows2000, remotely through a VPN.

********** CODE START ***********
If Not IsLoaded("Action Message") Then Stop

Forms![Action Message]![Message] = "Adding Technical Specs"
Forms![Action Message].Repaint
DoEvents

'2)Tech Specs
Dim rsDupTechs As Recordset 'TechSpecs new record
Dim rsOrderTechs As Recordset 'TechSpecs current record
'Duplicate Technical info
Set rsDupTechs = dbs.OpenRecordset("Order Entry Technical Specs",
dbOpenDynaset, dbSeeChanges) 'Duplicated Technical Specs
Set rsOrderTechs = dbs.OpenRecordset("CopyOrder3TechSpecs",
dbOpenDynaset, dbSeeChanges) 'Technical Specs of current record
strCriteria = "[OrdID] = " & [ordID]
rsOrderTechs.FindFirst strCriteria
'Do Until rsOrderTechs.EOF
rsDupTechs.AddNew
For Each fld In rsOrderTechs.Fields
On Error Resume Next
'If Left(fld.Name, 3) = "Det" Then
If fld.Name <> "OrdID" Then
rsDupTechs.Fields(fld.Name) = fld
End If
Next fld
On Error GoTo error_Section
rsDupTechs![ordID] = lngOrdID
rsDupTechs.Update

Set rsDupTechs = Nothing
Set rsOrderTechs = Nothing

'Find new Order on form
Set rsOrder = Me.RecordsetClone
strCriteriaOrd = "[ordID] =" & lngOrdID 'Reset strCriteriaOrd
rsOrder.Requery
Me.Requery
rsOrder.FindFirst strCriteriaOrd
If Not rsOrder.NoMatch Then
pubNoRequery = True
Me.Bookmark = rsOrder.Bookmark
pubNoRequery = False
End If
[ordCustID].SetFocus

If Not IsLoaded("Action Message") Then Stop
********** CODE END ***********

Thanks for any help and God Bless,

Mark A. Sam
 

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