Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

How do I save field data on a Form to a table?

Discussion in 'Information Technology' started by Angus Comber, Jul 28, 2006.

  1. Angus Comber

    Angus Comber
    Expand Collapse
    Guest

    Hello

    I have fields on a form. The fields are unbound. I have checked values and
    now want to save to a table called MyTable. how do I do that?

    AC
     
  2. Loading...

    Similar Threads Forum Date
    Convinced By Sikh, Muslim Family Saves Hindu Lives Interfaith Dialogues Jun 24, 2016
    S Asia Sikhs want Nawaz Sharif to help save Pakistan Gurdwaras Breaking News Jan 23, 2014
    Save Your Sanity for Less (Financial Fix Video) Business, Lifestyle & Leisure Jan 15, 2014
    Sikhi is in Ruins. How Can We Save It? Sikh Sikhi Sikhism Jan 4, 2013
    Save the Historical Gurdwaras in Pakistan Sikh Gurdwaras Dec 21, 2012

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    You'll have to write an INSERT query to take the values from the form and
    populate the table.

    Dim strSQL As String

    strSQL = "INSERT INTO MyTable (Field1, Field2, Field3) " & _
    "VALUES(" & Me.Text1 & ", '" & Me.Text2 & "', " & _
    Format(Me.Text3, "\#mm\/dd\/yyyy hh\:nn\:ss\#") & ")"
    CurrentDb.Execute strSQL, dbFailOnError

    The above assumes that Field1 is numeric, Field2 is text and Field3 is
    Date/Time.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Angus Comber" <nospam@gmail.com> wrote in message
    news:u04dOSdpGHA.3288@TK2MSFTNGP03.phx.gbl...
    > Hello
    >
    > I have fields on a form. The fields are unbound. I have checked values

    and
    > now want to save to a table called MyTable. how do I do that?
    >
    > AC
    >
    >
     
  4. Stuart

    Stuart
    Expand Collapse
    Guest

    Angus,

    It would have been easier for you as I'm sure you know if you had bound the
    fields to fields in the table. Barring that, you can write DAO or ADO code
    to open the recordset "mytable", move the data field by field, and write a
    record. Or, you could do an "Insert into...." sql command and add a table
    record that way.

    S

    "Angus Comber" wrote:

    > Hello
    >
    > I have fields on a form. The fields are unbound. I have checked values and
    > now want to save to a table called MyTable. how do I do that?
    >
    > AC
    >
    >
    >
     
  5. Larry Linson

    Larry Linson
    Expand Collapse
    Guest

    "Angus Comber" <nospam@gmail.com> wrote in message
    news:u04dOSdpGHA.3288@TK2MSFTNGP03.phx.gbl...
    > Hello
    >
    > I have fields on a form. The fields are unbound. I have checked values
    > and
    > now want to save to a table called MyTable. how do I do that?


    My very strong suggestion is that you bind the Form to a Query or Table,
    because using unbound Forms and code not only means you are re-inventing,
    re-implementing, and re-testing capability that is the primary reason people
    find Access so useful, but that you are costing yourself, your employer, or
    your client unnecessary time and money.

    If you feel compelled to stick with the unbound Form, Doug has already
    responded.

    Larry Linson
    Microsoft Access MVP
     

Share This Page