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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOCMD COPY OBJECT 1

Status
Not open for further replies.

villica

Programmer
Feb 25, 2000
332
CA
I would like the user to click a button on a form and the code behind the button to create a form for data entry and also create another button that creates a table.<br><br>I used the following code, but this command also copies the data inside the table. Is there another command that copies one table into another but just the structure. If possible I like the user the enter the table name. Can anyone give me any suggestions.<br><br>DoCmd.CopyObject, &quot;Employees Copy&quot;, acTable, &quot;Employees&quot; <p>Villica<br><a href=mailto:villica67@hotmail.com>villica67@hotmail.com</a><br><a href= > </a><br>
 
I don' want the user to create a table manually so create a button that is label create table so I attached the following code to the on click event. DoCmd.CopyObject, &quot;Employees Copy&quot;, acTable, &quot;Employees&quot; <br><br>The same table is created every month so I just wanted to copy the table from the previous month to a table for the new month without having the user do anything just point click. I don't need the data and just need the table struture so that they can enter data right into the table for the current month. Thank you <p>Villica<br><a href=mailto:villica67@hotmail.com>villica67@hotmail.com</a><br><a href= > </a><br>
 
I have a similar button that creates a table and automatically gives the setup<br><br>dim maker as string, db as database<br><br>Set db = DBEngine.Workspaces(0).Databases(0)<br><br>maker = &quot;CREATE TABLE [New table Name]([field name]field type)<br>db.Execute (maker)<br><br>then you enter each field name and type separating each with a comma inside of the parentheses. Hope this helps<br> <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top