473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.

Oct 5 '06 #1
3 4383
You could:

Assuming table2 is filled from form controls
Assuming fields of StartDate, EndDate, Name in table2
'Pass the values of your fields to a procedure like this.

Sub FillTable2(dtStart, dtEnd, strName)
Dim DB As database
Dim rs2 As Recordset
Dim dtMark As Date
Set DB = CurrentDb
Set rs2 = DB.openrecordset("Students", dbopendynaset)
rs2.MoveLast
For stMark = dtStart To dtEnd
rs2.AddNew
rs2.StartDate = dtMark
rs2.EndDate = dtMark
rs2.Name = strName
rs2.Update
Next
End Sub

I wonder though if there isn't some way to do this with a query.
PS Why do you want to store a date twice?

<co*********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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.

Oct 5 '06 #2
The first assumption is that table1 NOT table2 is filled from form.
"Kc-Mass" <co********@comcast.netwrote in message
news:Vv******************************@comcast.com. ..
You could:

Assuming table2 is filled from form controls
Assuming fields of StartDate, EndDate, Name in table2
'Pass the values of your fields to a procedure like this.

Sub FillTable2(dtStart, dtEnd, strName)
Dim DB As database
Dim rs2 As Recordset
Dim dtMark As Date
Set DB = CurrentDb
Set rs2 = DB.openrecordset("Students", dbopendynaset)
rs2.MoveLast
For stMark = dtStart To dtEnd
rs2.AddNew
rs2.StartDate = dtMark
rs2.EndDate = dtMark
rs2.Name = strName
rs2.Update
Next
End Sub

I wonder though if there isn't some way to do this with a query.
PS Why do you want to store a date twice?

<co*********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>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.


Oct 5 '06 #3
Correction 2 - The refrence to pass the "value of your fields" should
obviously be pass the "value of your form controls".
Sorry - That was a long night
"Kc-Mass" <co********@comcast.netwrote in message
news:p8******************************@comcast.com. ..
The first assumption is that table1 NOT table2 is filled from form.
"Kc-Mass" <co********@comcast.netwrote in message
news:Vv******************************@comcast.com. ..
>You could:

Assuming table2 is filled from form controls
Assuming fields of StartDate, EndDate, Name in table2
'Pass the values of your fields to a procedure like this.

Sub FillTable2(dtStart, dtEnd, strName)
Dim DB As database
Dim rs2 As Recordset
Dim dtMark As Date
Set DB = CurrentDb
Set rs2 = DB.openrecordset("Students", dbopendynaset)
rs2.MoveLast
For stMark = dtStart To dtEnd
rs2.AddNew
rs2.StartDate = dtMark
rs2.EndDate = dtMark
rs2.Name = strName
rs2.Update
Next
End Sub

I wonder though if there isn't some way to do this with a query.
PS Why do you want to store a date twice?

<co*********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googleg roups.com...
>>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.



Oct 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: cv | last post by:
Hi all, I have to copy two set of data from 2 files(notepad/excel) say, products and their corresponding prices to list/textarea/table. I should be able to retrieve the product and corresponding...
5
by: Peter CCH | last post by:
Let's say, I have Table1 and Table2, both with the exactly same structure and data in it, except that Table1.Field1 is empty in data but Table2.Field1 have data in it. How could I copy all the...
3
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
5
by: Clodoaldo Pinto Neto | last post by:
Hello, How to make sure COPY TO writes the table lines to the file in the same order they were inserted? I'm producing html pages in pl/pgsql and using COPY TO to write then to file....
6
by: sql_server_user | last post by:
I'm trying to copy all 440 million rows from one table in my SQL Server 2005 db to another table with a different clustering scheme. After a few test inserts that were successful (up to a million...
4
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new...
1
by: David | last post by:
Hi, I have an MS Access app which lets me create a new product by copying data from another selected product. All works fine, except one of the copy updates which I cannot fathom. The code...
2
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
4
by: remya1000 | last post by:
i'm using VB.NET i have 4 computers in network. when i press a button i need to delete a table from computer 2,3,4 and i need to copy that table from computer 1 to 2,3,4. and this file is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.