Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    make table (Access 2000)

    i want to make a new table with code and not by copying and pasting it.I know tah copying and pasting is the best way, but i have to
    arrange for that in other town.I want to copy the whole all the fields from the old table except one field, called Uni.How can i give the command to make the new table and copy the contents but one field?

    Thank you in advance

  2. #2
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: make table (Access 2000)

    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: make table (Access 2000)

    You can copy the entire table, then drop one field:

    Dim strOldTable As String, strNewTable As String, strField As String

    strOldTable = "tblOld"
    strNewTable = "tblNew"
    strField = "Uni"

    ' Copy the table
    DoCmd.CopyObject , strNewTable, acTable, strOldTable

    ' Remove one field
    DoCmd.RunSQL "ALTER TABLE [" & strNewTable & "] DROP COLUMN [" & strField & "]"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •