Thanks Thanks:  0
Results 1 to 5 of 5

Thread: Adding record to Another Table

  1. #1
    Board Regular
    Join Date
    Jan 2013
    Posts
    314
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Adding record to Another Table

    Hello,

    I was wondering if it is possible to create a macro to paste record from a form (Student ID, using Student ID Table), into a different table (main_data) and delete record?

    If so, how is this possible?


    Thank you

  2. #2
    Board Regular
    Join Date
    Jun 2015
    Location
    Ontario, Canada
    Posts
    1,600
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Adding record to Another Table

    Use an append query to copy the data from tbl1 to tbl2, then another query to delete from tbl1, assuming that's what you mean. If you need a macro because this is not a one-time thing, then create the macro to execute those steps. You might want to practice on copies of those tables first.
    Tips for posting problems:
    1) "doesn't work" doesn't help. Post error message text/numbers and/or state what's happening.
    2) if posting code or sql, use code tags; specify on which code line errors occur, if applicable
    3) try to be specific; assume we know nothing about your issue - because we don't!

    Make all suggested changes in copies of your database or to its objects.

    "1 out of 1010 people understand binary. The other 1001 don't."

  3. #3
    Board Regular
    Join Date
    Jan 2013
    Posts
    314
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Adding record to Another Table

    Hello,

    Can you give a example on how to do both options?


    Thank you

  4. #4
    Board Regular
    Join Date
    Jun 2015
    Location
    Ontario, Canada
    Posts
    1,600
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Adding record to Another Table

    You want me to tell you how to create an append query and a delete query? Or are you asking about code? You asked for a macro, but I don't do macros so I'm very unfamiliar with them. There's lots of instructions on the web on how to do either of these things and you'd be better off if you found one or more that apply to your situation. Here's what a query sql might look like if I wanted to copy from tblAscii into tblAscii2 where the key values in the 1st table are less than 40

    Code:
    INSERT INTO tblAscii2 ( [CodeValue], [Character], [Desc] )
    SELECT tblAscii.CodeValue, tblAscii.Character, tblAscii.Desc
    FROM tblAscii WHERE (((tblAscii.CodeValue)<40));

  5. #5
    New Member
    Join Date
    Oct 2018
    Location
    USA
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Adding record to Another Table

    The MS Access is the well-known database. We can add data from one table to another table by using these query below.
    INSERT INTO TABLE2 SELECT * FROM TABLE1
    INSERT INTO TABLE2 SELECT * FROM TABLE1 WHERE COL1 = 'X'
    These queries will help you so much. I am getting the issue in MS Access because it is not working properly means virus issue. What should I do to resolve this issue? I install Avast antivirus and also try on
    avast customer service for the help purpose but did not get any response.




Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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