ok,
this is the code which I have to wait for a moment when copy finished:
Private Sub Command99_Click()
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "Access Files (*.MDB)", "MDB")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=False, _
DialogTitle:="áØÝÇ äÇã ÝÇíá ÌÏíÏ ÑÇ æÇÑÏ äãÇÆíÏ...", _
Flags:=ahtOFN_HIDEREADONLY)
'-------------------------------------------------------------------
' PURPOSE: Copy a file on disk from one location to another.
'-------------------------------------------------------------------
Dim CopyString As String
Dim SourceFile As String
Dim DestFile As String
Dim TimeStamp As String
If strInputFileName <> "" Then
SourceFile = Chr(34) & [Master Data Location] & Chr(34)
DestFile = Chr(34) & strInputFileName & ".mdb" & Chr(34)
CopyString = "CMD.EXE /C COPY " & SourceFile & " " & DestFile
Call Shell(CopyString, vbNormalFocus)
End If
'-------------------------------------------------------------------
' PURPOSE: Link to DestFile created on above.
'-------------------------------------------------------------------
Dim i As Integer
DestFile = strInputFileName & ".mdb"
If IsNull(DestFile) Then
MsgBox "åí? ÝÇíáí ÓÇÎÊå äÔÏå ÇÓÊ!", vbExclamation
GoTo Done
End If
For i = 1 To UBound(LinkedTables, 2)
LinkedTables(4, i) = DestFile
Next i
LinkErrors = False
DoCmd.Hourglass True
For i = 1 To UBound(LinkedTables, 2)
LinkedTables(3, i) = AttachTable(LinkedTables(0, i), LinkedTables(4, i), LinkedTables(2, 1))
If Len(LinkedTables(3, i)) > 0 Then LinkErrors = True
Next i
DoCmd.Hourglass False
If LinkErrors = True Then
Me.ViewTabs.Pages("List").Visible = False
Me.ViewTabs.Pages("Errors").Visible = True
Me.ViewTabs.Pages("Errors").SetFocus
MsgBox ("ÚãáíÇÊ ÇÊÕÇá Èå ÈÇä˜ ÏÑÎæÇÓÊí ÌÏíÏ ÏÇÑÇí ÎØÇ ãí ÈÇÔÏ")
Else
If Me.OpenArgs = "Startup" Then
DoCmd.Close
Exit Sub
End If
Me.ViewTabs.Pages("List").Visible = True
Me.ViewTabs.Pages("Errors").Visible = False
Me.listStatus.Requery
Me.listStatus.SetFocus
'-------------------------------------------------------------------
' PURPOSE: To make requery and cleaning the tables.
'-------------------------------------------------------------------
Stdoc = "main form"
DoCmd.Close acForm, Stdoc
DoCmd.OpenForm Stdoc
DoCmd.OpenQuery "Deete Invoice"
DoCmd.OpenQuery "Delete Check Detail"
DoCmd.OpenQuery "Delete Havale Anbar"
DoCmd.OpenQuery "Delete Main Master Document"
DoCmd.OpenQuery "Delete Master Document"
DoCmd.OpenQuery "Delete Personel Working Detail"
DoCmd.OpenQuery "Delete Resid Anbar"
DoCmd.OpenQuery "Delete Ship Info"
Stdoc = "ezf_AttachmentManagerOneFile"
DoCmd.Close acForm, Stdoc
Forms![Main Form]![Master Data Location] = DestFile
Stdoc = "Name Registery"
DoCmd.OpenForm Stdoc
Stdoc = "Warning1"
stLink = "
Code:
=" & 83
DoCmd.OpenForm Stdoc, , , stLink
End If
Done:
End Sub
thanks for your help
Ali