Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Aug 2002
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    change filed property of table (Access 2000)

    Field property in a table

    I have a field called Quantity where the Required property is set to Yes.I want to change it to No.
    In other words, I need to change in the table "order details" the required property of the field Quantity from Yes to No, but through code.
    I can easily change this property by opening the table in design view,nothing easier than that.I need however to ship this function to different users in the

    country, and these users cannot open the table "order details", the table being protected. So i will ship them a form with the code through an OnClick event.
    I hope i am clear with what i want to do and will be grateful for any help.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: change filed property of table (Access 2000)

    What you are asking can be done in VBA using the TableDef object and manipulating fields. However it is a somewhat risky proposition, fairly complicated, and would require that you be quite proficient with VBA and the Access object model. In addition, if you have security implemented, you may not be able to change the design without logging in as a user with design permissions.

    The more fundamental question is if you want to do this more than once. If you only want to do it once, you might consider creating a new table with the desired characteristics, delete or rename the old table, and then rename the new table to the original table name. That would avoid having to write the code to manipulate the table design, and is inherently less risky. On second thought, I can't figure out why you would ever want to do this more than once. Am I wrong? Hope this doesn't muddy the waters too much.
    Wendell

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: change filed property of table (Access 2000)

    If it is a split FE/BE, have a look at the <!post=Back End Upgrader, 163331>Back End Upgrader<!/post>.

    It will allow you to do that, or make any other changes in the structure of the BE.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

Posting Permissions

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