I find that I have to comment out the line ".hwnd = hWndAccessApp". If I
don't, I get a "Microsoft Access has encountered a problem and needs to
close. We are sorry for the inconvenience" error box. However, obviously
you're not encountering that problem, or you would have mentioned it...
I have found an error in the code. Technically, where it's assigning values
to .pFrom and .pTo, it should be appending vbNullChar & vbNullChar, not
simply vbNullChar. However, even with that error, it still works for me
(after commenting out the line)
I'm at a loss for what else to suggest. I suppose that once the copy has
completed, you could use the VBA Name function to rename the file:
If Len(Dir("C:\Documents and Settings\acunningham\MyDocuments\Copy of Filing
2000.mdb")) > 0 Then
Name "C:\Documents and Settings\acunningham\MyDocuments\Copy of Filing
2000.mdb" _
As "C:\Documents and Settings\acunningham\MyDocuments\Filing 2000.mdb"
End If
but that shouldn't be necessary!