Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Kingwood, Texas, USA
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set table field format programmatically (Access 97)

    I want to create a new table field using ALTER TABLE. "ALTER TABLE tblEmployee ADD Column HavePhoto YesNo;" works just fine, but then how can I get the new field to have a YesNo format as well as the YesNo data type? Since I suspect I might not be able to do this with the ALTER TABLE command, I tried to do it from a form, but couldn't come up with the proper syntax (or something). Can anyone tell me how to do this?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Set table field format programmatically (Access 97)

    You can't do it either way. You have to use DAO code to set the properties of the field object. If you're going to all that trouble, you might as well create the field and set those properties at the same time. Look up "CreateField" in Access on-line help. It includes a sample of code to create a field and append it to a table.
    Charlotte

Posting Permissions

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