|
Thread: Vba
-
Jul 30th, 2001, 10:10 AM
#1
Thread Starter
Fanatic Member
Vba
The following VBA code works but the copy object part does not.:
**************************************************************************************************** ****
Private Sub Form_Load()
Dim strSQL As String
'sql string
strSQL = "Delete * from tblOutput"
DoCmd.SetWarnings False
'delete tblArchive
DoCmd.DeleteObject acTable, "tblOutputArchive"
'copy tblOutput to a new tblEMPArchive table
DoCmd.CopyObject "dbPhonelist", "tblOutputArchive", acTable, "tblOutput"
'make sure no warning messages come up
'run the sql query to delete everything in tblOutput, this way when
'we import it only adds the records being imported
DoCmd.RunSQL strSQL
'transfer text file into the tblOutput table
DoCmd.TransferText acImportFixed, "Standard", "tblOutput", "g:\phonelist\output.txt", True
DoCmd.Quit acQuitSaveAll
End Sub
**************************************************************************************************** ****
At the end after it closes the DB it says "Cannot find c:\windows\desktop\dbphonelist.mdb or one of its components."
And the copy does not get accomplished..Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|