CopyObject

indesisiv

Access - What's that?
Local time
Today, 06:45
Joined
Jun 13, 2002
Messages
265
Hi there.

I have what i think is a simple question but it has stumped me.
I am using the docmd.CopyObject
DoCmd.CopyObject "path To DataBase", "New TableName", acTable, "Source Table Name"

What i want to do is set the "path to database" to the current directory. because the databases can be in different directories.

Any ideas?

Failing that is there a way to use the open dialogue box to select a directory or database?

Steve
 
Here's how I do it:
Dim dbs as database, rst as recordset
set dbs= OpenDatabase(locatetables())
set rst=dbs.openrecordset("tablename",......
.......

Function locatetables() As String
locatetables = DLookup("[tablepath]", "tablelocs", "[recno]=1")
End Function

I have a 1 record table named "tablelocs" that resides with the moduules, forms, etc (not split out). I chose this method because some of my applications need to able to link to different locations. My relink module changes the record in tablelocs to reflect the current table location.
 

Users who are viewing this thread

Back
Top Bottom