Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open/Clososing form issue

Status
Not open for further replies.

bgreen

Programmer
Feb 20, 2003
185
CA
Hi,

My application is freezing up. I am unsure why.
I am running the following code. Form frmfrmDataEntry is open, a button to create a file is pressed and Form frmExportWarning is opened. I hit OK button on the frmExportWarning and then a FTP form is to open but it does not appear and the app seams to freeze up. Is there some code I need to fix? Help please.

From Form frmfrmDataEntry:
--------------------------

I am entering some data to create a file, then click a button to create a file

This opens another form frmExportWarning, which warns the user of actions to happen. The user clicks OK button which is called cmdWarnOK. (Below)

From Form frmExportWarning:
---------------------------

Private Sub cmdWarnOK_Click()
Call ChqFile
End Sub


In Module:
----------
Function ChqFile()
On Error GoTo ChqFile_Err

Dim sLocalFile As String
Dim sLocalFLD As String
Dim sArchiveFLD As String
Dim sArchDest As String
Dim sSource As String

Const q As String * 1 = """"

sLocalFLD = DLookup("LocalPath", "tblDirectories")
sArchiveFLD = DLookup("ArchivePath", "tblDirectories")

DoCmd.Echo False, ""
' Set Export Time Value
Forms!frmDataEntry!Time = Time()

sLocalFile = ("CHQ" & Format(Now(), "yymmddhhnnss") & "UPLOAD.txt")
sSource = sLocalFLD & "\" & sLocalFile

' Print Export Report
DoCmd.OpenReport "rptExportReport", acViewNormal, "", "", acNormal
' Update Export Table (tblExportData)
DoCmd.OpenQuery "qryUpdateExportDataTable", acViewNormal, acEdit
DoCmd.TransferText acExportDelim, "CLIC Tilde Export Specification", "tblExportData", sSource, False, ""
' Update History Table (tblHistory)
DoCmd.OpenQuery "qryAppendHistory", acViewNormal, acEdit
' Delete data in tblData
DoCmd.OpenQuery "qryDelete tblData", acViewNormal, acEdit
' Delete date in tblExportData
DoCmd.OpenQuery "qryDelete tblExportData", acViewNormal, acEdit

MsgBox "File " & sLocalFile & " Created.", vbInformation, ""

DoCmd.Close acForm, "frmExportWarning"
DoCmd.Close acForm, "frmfrmDataEntry"

' Open FTP form to transfer file to FTP site
DoCmd.OpenForm "frmFTPFile", acNormal, "", "", , acNormal


ChqFile_Exit:
Exit Function

ChqFile_Err:
MsgBox Error$
Resume ChqFile_Exit

End Function


 
I'd either comment out the DoCmd.Echo False line or add a DoCmd.Echo True line after the OpenQuery calls.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I commented out the DoCmd.Echo command and that appears to have worked. Thanks!

Whats the point of this statement if it causes freezing issues?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top