Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2006
    Posts
    4

    Unanswered: How to create a new colum in a table from a form

    Hello everyone

    I'm having a hard time trying to create a new column in a table but from a form I created.
    I tried this: I opened my table and added a new column, I closed it and then I open my form (which is linked to the table I'm talking about), then I go to "design view" and open my Field List and the new "column" I created doesn't come out, is not there... I know I'm doing something wrong.Please I need help.

    Thanks you very much

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Is the record source for your form a query? Look at the record source of your form (click the ...) and see if the field is in that query. If it isn't, it won't show as a field list on the form. Otherwise, you might need to simply close and reopen the form in design view as sometimes it doesn't get refreshed if you have the form open and add a new field to the underlying table.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Sep 2006
    Posts
    4
    My records source is not a query, is a table. Once I create a new column in the table, I close it and then I open my form and then I go to design view and open my "field list" and I don't see the new column I just created. There is anyway to "update" the "field list" once I add new columns in my underlying table?. Thanks pkstormy..!!

    Agentjude

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Perhaps if you select the table in the dropdown again as the record source. I've seen this happen where it doesn't always refresh the field list to the form and you need to re-select the table again for the record source. Usually it refreshes by simply closing and re-opening the form.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Sep 2006
    Posts
    4
    pkstormy, where is the dropdown you are talking about?, where is located?, is in the design view of the form?... thak you again.

  6. #6
    Join Date
    Sep 2006
    Posts
    4
    pkstormy, I went to the help online and I found out that I can update the field list by opening it and then click on the "refresh" icon, which is located in the "field list toolbar", which I can't find it... I went over all the toolbars and none of them is a "field list toolbar"... please help me find it. Than you again pkstormy..! This is the link I found: http://office.microsoft.com/en-us/as...741751033.aspx
    Last edited by agentjude; 09-13-06 at 00:59.

  7. #7
    Join Date
    Nov 2003
    Posts
    1,487
    To add a column to a table you can use the ALTER TABLE SQL Statement. Something like:

    Code:
    CurrentDB.Execute "ALTER TABLE yourTableName ADD COLUMN newFieldName Text(75);"
    


    Now update the database....you can use this function.

    Code:
    Public Sub TablesRefresh()
       ' -----------------------------------------------------------------------------
       ' Description:
       ' Refresh the Database Window and Table Definitions
       '
       ' Syntax:
       ' TablesRefresh
       '
       ' Example:
       ' =======
       ' TablesRefresh
       '
       ' RETURNS:
       ' =======
       ' None
       ' -----------------------------------------------------------------------------
       
       ' Refresh the Database Window
       Application.RefreshDatabaseWindow
       'Refresh the Table Definitions Table
       Application.CurrentDb.TableDefs.Refresh
       DoEvents
    End Sub
    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  8. #8
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Jude, the drop down Paul is talking about is in the properties window.
    Ryan
    My Blog

Posting Permissions

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