Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add Field in VBA (Access 2000)

    What will the code be if I want to add a field "Age" to a Table Users. Should I use a SQL statement or VBA?

    Thanks

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Add Field in VBA (Access 2000)

    Either way will work.

    Pat

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

    Re: Add Field in VBA (Access 2000)

    SQL is short and easy: execute an SQL string like this:

    "ALTER TABLE MyTable ADD COLUMN Age Short"

    You can also use DAO or ADOX (you need to set the appropriate reference to be able to use those)

  4. #4
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add Field in VBA (Access 2000)

    Thanks for the code, a bit confused by the short but then realised that it identified the type of field.

Posting Permissions

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