How can i add a column to a fixed table??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NoDBExperience
    New Member
    • Mar 2007
    • 15

    How can i add a column to a fixed table??

    G'day guys.
    I would like to know if there is a way to add columns to a fixed table?
    Each time i go to add a column, the forms don't work and all kinds of error messages result.

    I think this must relate to name conventions...
    If that is the case, since the DB was hard coded, this poses a limitation on the DB. Therefore, is there ANY way around this problem, or is there a fix it patch for such a problem that would either correcting the coding to enable you to add columns, fields with out causing problems or errors in the DB?

    I am really wanting to add more funtionality to this DB by adding additional columns, but am always met with more problems.

    ANY advice would be greatly appreciated.

    RAJ
  • cjbrx3115
    New Member
    • Jan 2007
    • 93

    #2
    Have you tried opening the table in design view? And add columns that way?

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      Originally posted by NoDBExperience
      G'day guys.
      I would like to know if there is a way to add columns to a fixed table?
      Each time i go to add a column, the forms don't work and all kinds of error messages result.

      I think this must relate to name conventions...
      If that is the case, since the DB was hard coded, this poses a limitation on the DB. Therefore, is there ANY way around this problem, or is there a fix it patch for such a problem that would either correcting the coding to enable you to add columns, fields with out causing problems or errors in the DB?

      I am really wanting to add more funtionality to this DB by adding additional columns, but am always met with more problems.

      ANY advice would be greatly appreciated.

      RAJ
      The following code will create 3 Fields (Text, Integer, and Date) in the tblTest Table. Hope this helps:
      Code:
      Dim MyDB As DAO.Database, tdf As DAO.TableDef
      
      Set MyDB = CurrentDb()
      Set tdf = MyDB.TableDefs("tblTest")
      
      With tdf
        .Fields.Append .CreateField("MyTestField", dbText)
        .Fields.Append .CreateField("MyIntegerField", dbInteger)
        .Fields.Append .CreateField("MyDateField", dbDate)
      End With

      Comment

      • NoDBExperience
        New Member
        • Mar 2007
        • 15

        #4
        Originally posted by cjbrx3115
        Have you tried opening the table in design view? And add columns that way?
        The main problem is not ONLY adding the column, but not affecting other parts of the DB. Most importantly, the DB must continue to fucntion and not fail as currently. exmaple... I can't close the forms, i can't adding information through forms...

        Actually adding columns to the table is not the problem, it is is doing that with out causing problems to the DB...

        Hope that helps explain my current problem.

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by NoDBExperience
          The main problem is not ONLY adding the column, but not affecting other parts of the DB. Most importantly, the DB must continue to fucntion and not fail as currently. exmaple... I can't close the forms, i can't adding information through forms...

          Actually adding columns to the table is not the problem, it is is doing that with out causing problems to the DB...

          Hope that helps explain my current problem.
          I can see it potentially causing problems if the Table you are adding Columns to is the underlying Record Source for an Open Form, but not in any other context. Did you run the code that I gave you and did you have the same results?

          Comment

          Working...