Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    157

    Unanswered: Copy data into another table

    Hi:
    Can any one please help me when user select 2 dates from DDLDate1 10/09/2006 and DDLDate2 10/12/06 and the name and it close the form. I need to create multiple records in the another table on the basis of two dates like that.

    Data in continous form table1
    -----------------------------
    Data entered in continous form
    10/09/2006 10/12/2006 John
    10/12/2006 10/13/2006 Petty
    11/11/2006 11/11/2006 Stiffny

    Required data into table table2
    10/09/2006 10/09/06 John
    10/10/06 10/10/06 John
    10/11/06 10/11/06 John
    10/12/06 10/12/06 John
    10/13/06 10/13/06 John
    10/12/2006 10/12/2006 Petty
    10/13/2006 10/13/2006 Petty
    11/11/2006 11/11/2006 Stiffny

    I am currently using a continuous form where there are two drop downs one for AppDate and other for EndDate. I need a script here once use close the form, Script check the data and create multiple records on the basis of date selection into table2. I am using two tables. One for the continous form and the other for the reports (Both have same fields). Continous form table i empty it every time once it close. So i need the result into another table assume form table name is table1 and table where i need multiple records name is table2.

    Thanks.

  2. #2
    Join Date
    Aug 2005
    Location
    Louisville, KY
    Posts
    28
    What you would need to do is something like this:

    If your tables names are "BeginDt", "EndDt", and "Name". You would need to say:
    x = 0
    y = EndDt - BeginDt

    Do until x > y
    BeginDt + x "put this value into your new table in both "NewBeginDt" and "NewEndDt" as well as the "Name"
    x = x + 1
    End Loop

    This will put the dates in both columns until it hits the end date making the table look as you wish.

    Im not the best in vba, but atleast understand the concept, so making the code work is up to you but this should do the trick.

Posting Permissions

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