Results 1 to 4 of 4
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Change Table Field Size in Code (A2k Sr1)

    I am using the Docmd.TransferDatabase command (see below) to import several MPM Tables.

    DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=MPM 2.2", acTable, "WBS", "WBS", False

    For this particular command the WBS table is loaded into access. The WBSID field that is loaded is a text field of length 20.

    After loading the WBS table, I need to re-set the length of the WBSID field in the WBS table to 50. Can I reset a fieldsize in a table in code and if so how? I do not want to define a new field but change the existing.
    Regards,

    Gary
    (It's been a while!)

  2. #2
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Table Field Size in Code (A2k Sr1)

    Found this whilst following another thread. Might do the trick.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Change Table Field Size in Code (A2k Sr1)

    Thanks Steve.

    That will work.
    Regards,

    Gary
    (It's been a while!)

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Change Table Field Size in Code (A2k Sr1)

    Steve,

    Thanks again. The code gave me a different idea. I will transfer table WBS to a temporary table WBS1. After transfer, code will copy the data to the table WBS where the size of the WBSID field is set correctly. I will then drop the WBS1 table object.
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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