View Full Version : Simple copy module


Rockape
01-07-2008, 03:20 AM
Hi all,

I'm working on this simple transfer ( i.e. a copy)

I've come up with this code:

Private Sub Command2_Click()
Dim objFSO As Object

Const OverWriteFiles = True
Set objFSO = CreateObject("Scripting.FileSystemObject")

Me.Frm_Loading.Visible = True

objFSO.CopyFolder "C:\1", "c:\11", OverWriteFiles


MsgBox "Copy complete"
Me.Frm_Loading.Visible = False

End Sub


I'm trying that on click the Frm_Loading becomes visible during the time the copy takes place. This is not happening!

The form becomes visible at the end together with the message box once the copy has taken place.

Can Someone show me where I'm going wrong??


Thanks.

boblarson
01-07-2008, 05:29 AM
Put DoEvents after the Me.Frm_Loading.Visible = True and it SHOULD work for you.

Rockape
01-07-2008, 06:19 AM
Thanks Bob,

Just didn't do it right the first time you told me..

Thanks once again...... :)

boblarson
01-07-2008, 03:59 PM
Glad you got it sorted :)