Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    6

    Unanswered: trying to set default value & validation in new table

    Hi folks

    I can create a new Access table with

    adSQL = "CREATE TABLE " &_
    cNewTable &_
    " (Name text (50), Email text (75), Comments text (255), Region text (50), DateUploaded date)"

    but can anyone tell me how to set a default value or validation rule for any particular field?

    Many thanks

    Gerard

  2. #2
    Join Date
    Jan 2004
    Location
    Oslo
    Posts
    45

    Re: trying to set default value & validation in new table

    Hi there..

    I'm not sure about the default values, but i know you can do like this to get validationrules for not accepting blanks. (ex : "NOT NULL")

    adSQL = "CREATE TABLE " &_
    cNewTable &_
    " (Name text (50) NOT NULL, Email text (75), Comments text (255), Region text (50), DateUploaded date)"

    YOu can altso specify primary key by setting :
    (ID char NOT NULL primary key, etc.ec..)


    Hope it helps..

    PS. I'll fill in if i can find out how to set default values..

    Best regards
    Mirador.

Posting Permissions

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