Results 1 to 7 of 7
  1. #1
    PPat is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    17

    Making an Append Query move specific record(s)

    Hi everyone,

    I am a college student working on an Access database for my job. To give a quick overview, I am creating a database where the records of individual students are to be moved to different table depending on where they are in the graduation process. In order to do this, the secretary will enter the student in the "90 Hr Request" table (think of it as the first step), and move them down the line of tables (4 in total) until the final "Completed" table. Each table in the progression has more and more fields. However, a student (with their ID number as the primary key) can only be in one table at a time.

    I understand this does not sound like a traditional, normalized database. However, this is being used more as a filing system than anything else. Their data is primarily paper based (for legality reasons), but wishes to keep it organized in a database so they can run queries and print reports.

    Currently, I am creating a macro that will run specific queries (in an order). I have made an append query that will move the records over, then I used a update (to null) and delete query combo to delete the old individual record. I made the delete + update query work by using a selected criteria.

    However, I cannot get figure out how to make the append query move only one student's record at a time. I am competent in VBA, but not as much in SQL, so a simplified explanation would really appreciated. If you need other pieces of information, please feel free to ask and I will provide. Also, any other tips you can give me would be appreciated since I'm still new to DBs and would like to learn more

    Thank you for your time
    Pete


  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What are you using now to append the record?

    You can use an INSERT SELECT with criteria in the SELECT part.

    INSERT INTO tablename SELECT field1, field2, field3, FROM tablename WHERE studentID = [enter student id];

    The [enter student id] parameter can be a reference to a control on form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    PPat is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    17
    I'm still in the process of creating the macro/module, but everything i have is in the picture below. And I'll try that now, but I think that would work perfect, thank you!! But how do I reference the control to the form (sorry, I'm new at this haha)? Because ideally I would like it so the user doesn't have to enter the number manually, but instead have the query take the student ID number in the textbox and move the associated records to the next table all within a button click event.
    Click image for larger version. 

Name:	Tables, Queries, and Macros.PNG 
Views:	17 
Size:	79.9 KB 
ID:	11744

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try like:

    Forms!formnamehere.textboxnamehere
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    PPat is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    17
    Almost, here is my SQL WHERE Statement that i have:

    WHERE [Student ID]=[90-Hr Sheet Request Form].StudentIDTextBox;

    It will append the row of whatever ID number I put it, but I'd like for it to just append the one on the screen/form automatically. Did I write the SQL wrong? (PS: Thank you for your help June7!)

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try:

    WHERE [Student ID]=Forms![90-Hr Sheet Request Form].StudentIDTextBox;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    PPat is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    17
    That's perfect, thank you so much! Sorry I took out the Forms! without realizing it. Much appreciated June7. I'll make this post "solved".

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Append Query Creates a New Record
    By burrina in forum Queries
    Replies: 5
    Last Post: 01-01-2013, 07:27 PM
  2. Append Query For Single Record
    By burrina in forum Queries
    Replies: 3
    Last Post: 12-30-2012, 11:23 PM
  3. Run Append Query at Specific Time
    By RachelBedi in forum Programming
    Replies: 4
    Last Post: 10-22-2012, 12:51 PM
  4. append query without duplicate record
    By smahdih in forum Queries
    Replies: 5
    Last Post: 11-16-2011, 12:29 AM
  5. making specific fields non-editable
    By narayanis in forum Forms
    Replies: 3
    Last Post: 08-06-2008, 12:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums