Allow user to add a field.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyWaterloo
    New Member
    • Dec 2007
    • 135

    Allow user to add a field.

    What is the best method to allow the end user to be able to add a field? Is there anyway to have a button or something on the form that would allow the user to create a new field without the user having to mess with the design?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Users don't add fields in Access databases, they add records!

    Users add fields in spreadsheets, such as Excel.

    Perhaps if you can give us some idea of exactly what you're trying to do here, and why you think you need this capability in a database, we can help you.

    Linq ;0)>

    Comment

    • Stewart Ross
      Recognized Expert Moderator Specialist
      • Feb 2008
      • 2545

      #3
      I can think of many reasons why users should not be adding fields to tables at all, and no circumstances in which it is a good thing - perhaps you can let us know why you need this particular option?

      It is possible to change table structures under program control, by changing the underlying TableDef contents, but even if you did how would your users enter data? You'd need to bind the new field to a form control, and as forms are normally bound to queries (not directly to a table) this not only means changing the design of the form to bind a new control it means changing the query design as well.

      Perhaps you could tell us more about what this one is about, so we can look at ways to do this that do not involve adding fields to a table under program control...

      -Stewart

      PS apologies for cross-posting Linq - glad to see I'm replying along the same lines as you!

      Comment

      • MyWaterloo
        New Member
        • Dec 2007
        • 135

        #4
        You answered my question. I am making a database that will contain information on municipal systems in my area. The problem with this database is not knowing exactly what fields will be needed. For example: currently the idea is for the information to include only address, location, municipality, type of municipal building, phone etc. and staff at that location. I am just trying to find a way to future proof without having to redesign or add fields later. I can come up with at least three more fields that could be useful, but are not currently in use. As I was thinking through my database I was pondering the possibility of a field being added by the user... has it ever been done?... how would one do such a thing?... is it worth it? In a table there is a "add new field" column. I didn't know if it was possible to bring this all the way through to a form. Have a "add new field" control on the form. Thanks.

        Comment

        • ajalwaysus
          Recognized Expert Contributor
          • Jul 2009
          • 266

          #5
          Originally posted by MyWaterloo
          You answered my question. I am making a database that will contain information on municipal systems in my area. The problem with this database is not knowing exactly what fields will be needed. For example: currently the idea is for the information to include only address, location, municipality, type of municipal building, phone etc. and staff at that location. I am just trying to find a way to future proof without having to redesign or add fields later. I can come up with at least three more fields that could be useful, but are not currently in use. As I was thinking through my database I was pondering the possibility of a field being added by the user... has it ever been done?... how would one do such a thing?... is it worth it? In a table there is a "add new field" column. I didn't know if it was possible to bring this all the way through to a form. Have a "add new field" control on the form. Thanks.
          I would have to concur with Stewart and Linq, this is not a good idea for multiple reasons, mainly, users usually have very little regard for database normalization and design, so they are more likely to make your database a design nightmare instead of making it easier on you.
          Besides, no offense, but designing and redesigning a DB is the DBA's job, I work at a place that in the past they allowed "users" to design their own fields and even entire tables, we now have a table with 157 million records in it and ZERO indexes, for those who understand databases, that ain't good.

          I hope you decide to keep this job in your hands, besides, it's job security =)

          -AJ

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Originally posted by ajalwaysus
            ...for those who understand databases, that ain't good.
            You don't need to tell us AJ. It's those others that don't understand that need telling :D

            I clearly don't need to add my two-pennorth here. This is just a bad idea.

            Comment

            Working...