View Single Post
  #2  
Old September 8th, 2004, 06:48 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

CopyObject is the problem. Use CreateTableDef() instead.
Alternatively, execute a DDL query statement such as:
dbEngine(0)(0).Execute "CREATE TABLE ...

However, it would probably be easier to just create the table in the front
end, and leave it there. Each user automatically gets the new table when you
give them the updated front end.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Bryan Hughes" wrote in message
...
Hello,

I have a table with a fe for users and be that holds just my tables

I have code that will create tables, but it creates them in the be and
links them, not in the fe where I want them to be used as temp tables and
deleted on opening and closing of the fe.

I use the fExistTable function to check if the table exists.

Then I run this sub from a class module:
Sub sClean_Local_Client()
On Error GoTo ErrorHandler
gstrSubProcName = "sClean_Local_Client()"

'Check to see if Local Client temp table exists
gblnTest = fExistTable("tblClient_Local_Temp")

'If table exists the clean information from table
If gblnTest = True Then
strSQL = "DELETE * FROM tblClient_Local_Temp;"

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
Else
'if table does not exist then create it
DoCmd.CopyObject , "tblClient_Local_Temp", acTable,
"tblUSys_Client_Local"
End If

. . .
End Sub

How can I make this table in the always be created in the users local fe
and not the be?
-TFTH
Bryan