Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2010
    Posts
    3

    Unanswered: Insert Into table sql

    Hello

    please can you help me with this code ?

    i need insert values from table tab_material_add to table tab_material

    in tab_material i have autonumber field

    i try this code

    Private Sub Form_Click()
    DoCmd****nSQL "Insert into tab_material (ROHS) Select ROHS From tab_material_add "
    Me.Requery
    End Sub

    thank you

    here is sample
    Attached Thumbnails Attached Thumbnails Bez názvu.jpg  

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Use Access' Query Designer. Select the Query tab, click on <New>, click on Design View and click <OK>.

    In the "Show Tables" box, click on the tab_material table and click <Add>. Change the query type to Append Query. When Access asks you for the table to append, type in (or select) "tab_material_add." In the tab_material table field display, double-click on the asterisk (*).

    If you don't have an auto-number in tab_material, the auto-number field in tab_material_add will increment nicely when you run the query, which is what you want. To run the query, click on the red exclamation point.

    Hope this helps,

    SL

  3. #3
    Join Date
    Jul 2010
    Posts
    3
    hello,

    did not like it entered into the database, can you please try? Here is a sample db
    Attached Files Attached Files

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Please can you be more specific than "did not like"? Your SQL is syntactically fine so we need to know exactly what didn't work (wrong result, error message etc.)
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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