How can I make this Work?
I am trying to make a function that uses the DoCmd.TransferDatabase tool but waits until it is done before going on. I used the coding behind the Shellwait function as an example but I keep getting the error: Expected Function or Variable. Here is the code, what is wrong?
Public Sub copywait(fNameTo$, pNewName$, pWhat As pWhats, pName$)
Dim hProcess As Long
Dim ProcessId As Long
Dim exitCode As Long
ProcessId& = appAccess.DoCmd.TransferDatabase(acExport, "Microsoft Access", fNameTo$, pWhat, pName$, pNewName$, True)
hProcess& = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessId&)
Do
Call GetExitCodeProcess(hProcess&, exitCode&)
DoEvents
Loop While exitCode& > 0
End Sub
and is called from a form where the database is already opened with this code:
copywait fNameTo, pNewName, pWhat, pName
The problem occurs at ProcessId&= yada...yada
Thanks
[Edited by Edneeis on 04-13-2000 at 02:21 AM]