Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    June7,


    I got this error. Originally, I thought it should be the AssignedDate but it gave me the same error. BTW, let me explain one more thing, I am so sorry. I had the StudentID created in another table first, then, try to copy and paste the template schedule (StudentID1) to a blank querry. Then, replace all the ID and dates accordingly.

    Click image for larger version. 

Name:	Capture 05.11.22.PNG 
Views:	12 
Size:	20.4 KB 
ID:	47781

  2. #17
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    June7,

    Ops, I did not realize it went to p2. I thought I did not do it. If the above post was confusing, may be this will help. Sorry


    I got this error message. What am I doing wrong? May be one more thing, I should explain, is I created a new StudentID from another table. Then manually copy and paste over the Template Schedule and change the schedule to be for the new StudentID and then manually changing the dates on those 81 items that were pasted to the right dates. I am trying to make it easier. Which the script works for it changed every records on every student. (which is not what I need). Ty again.

    Click image for larger version. 

Name:	Capture 05.11.22.PNG 
Views:	11 
Size:	20.4 KB 
ID:	47785

  3. #18
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    So you want to 'batch create' records for a single new student, not existing students? You want to automate the 'copy/paste'? How do you decide which set of [Template Schedule] records to copy/paste - i.e., why is 3/14/2022 the first date in your example?

    Have to replace tablename with your actual table name (perhaps that is [Template Schedule]) as well as textbox names with your actual control names. If you did not create a textbox for input of old date to start with, how do you want to specify date to start with?

    "created a new StudentID from another table" - you created a new student record? In what table - Students? Will have to concatenate the StudentID in the SELECT part.

    "SELECT " & Me.tbxStudID & "...

    This might go a lot faster and easier if you provide your data schema. Could just provide db for analysis. Follow instructions at bottom of my post.

    Strongly advise not to use space in naming convention, better would be TemplateSchedule.
    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.

  4. #19
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    So you want to 'batch create' records for a single new student, not existing students? Yes.

    You want to automate the 'copy/paste'? Yes

    How do you decide which set of [Template Schedule] records to copy/paste - i.e., why is 3/14/2022 the first date in your example? (3/14 was just an arbitrary start date)

    Have to replace tablename with your actual table name (perhaps that is [Template Schedule]) as well as textbox names with your actual control names. If you did not create a textbox for input of old date to start with, how do you want to specify date to start with? >> Stupid me! No. I just did that but still same error messsage.

    Dim intDays As Integer


    intDays = Me.tbxNewDate - Me.tbxOldDate


    CurrentDb.Execute "INSERT INTO tblJtnStudentsCourses(StudentID, CourseDetails, DateAssigned, TimeBegins, TimeEnds, Instructor) " & _
    "SELECT StudentID, CourseDetails, DateAssigned + " & intDays & ", TimeBegins, TimeEnds, Instructor FROM tablename WHERE DateAssigned >=#" & Me.tbxOldDate & "#"




    "created a new StudentID from another table" - you created a new student record? In what table - Students? Will have to concatenate the StudentID in the SELECT part. Yes.

    "SELECT " & Me.tbxStudID & "...

    This might go a lot faster and easier if you provide your data schema. Could just provide db for analysis. Follow instructions at bottom of my post. (I agree. I am so sorry. )

    Strongly advise not to use space in naming convention, better would be TemplateSchedule. OK

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-09-2019, 07:09 PM
  2. How to search for subsequent dates in form
    By Beeblebrox in forum Programming
    Replies: 13
    Last Post: 04-28-2016, 10:14 AM
  3. Replies: 7
    Last Post: 11-01-2013, 03:17 PM
  4. 'LastUpdated' fiedld be automatically updated
    By djclntn in forum Programming
    Replies: 8
    Last Post: 02-22-2013, 03:57 PM
  5. Trying to Automatically update date within form
    By accesskid in forum Programming
    Replies: 4
    Last Post: 04-26-2011, 07:45 AM

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