Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006

    Unanswered: Insert record from a form to a table

    Hi...I'm sorry if I have so many questions lately but I'm trying tlo append an entire record into a table but I'm not having much success in executing it. I was wondering if anyone could help me with my code:

    Dim strSQL As String
    strSQL = "INSERT INTO [tblArchive] (*) " & _
    "VALUES (""" & Me![Records].(*) & """)"
    CurrentDb.Execute strSQL, dbFailOnError
    This might seem very simple to some of you but I'm gradually trying to learn MS Access. Greatly appreciate the help!

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    thata a new variant of Insert...
    I'd expect
    strSQL ="insert into mytable (my,comma,separated,column,list) values (numericValue, "stringvalue", TRUE,100,"abc")

    you could possibly get away with
    values (me!records.column(0),me!records.column(1),!r ecords.column(5))

    personally I would advise against using such shorthand in code... it may take a little longer to write but its more explicit, more obvious what you are trying to do.... its also easier if you revisit the code or have to look at making a change.

    try to avoid select * or other operatiosn using * in place of column names
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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