Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2002: What is the command to find table...

Status
Not open for further replies.

dreman

Programmer
Joined
Jan 16, 2002
Messages
272
Location
US
I have a form, within this form I have a button to backup a specific file.
But I would like to rename the existing backup to backup.daytime then do the backup.
I am trying to find the command of finding the table before renaming it. (In case it does not exists)
I know how to use:
DoCmd.CopyObject , "Backup Copy", acTable, "Backup"
but i get an error if Backup does not exists.

Please advise,
Thank you.
 
Try to use a little error trapping.

On Error Resume Next
DoCmd.CopyObject , "Backup Copy", acTable, "Backup"
If Err.Number <> 0 Then
MsgBox &quot;The table 'Backup' does not exist&quot; & vbCrLf _
& &quot;Give it another shot when you feel like it.&quot;
Exit Sub
End If


-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top