|
-
Jun 25th, 2000, 02:27 AM
#1
Thread Starter
New Member
I need to append a records based on a date from one Access table to another and then delete the same records from the origin table. I've got the query worked out but apparently am not making the correct reference to the data control. I'd appreciate an example if someone's got one available.
-
Jun 25th, 2000, 02:30 AM
#2
Hyperactive Member
more info required...
in what way are you not making the correct reference to the data control, e.g. how do you know your not (what error message do you get)?
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Jun 25th, 2000, 02:39 AM
#3
Thread Starter
New Member
I tried setting the data control recordsource to "query statements" followed by a refresh. That gives an invalid operation. Is that the correct reference to preceed the query statements?
-
Jun 25th, 2000, 02:53 AM
#4
Hyperactive Member
"query statements" ?
i presume by this you are setting the recordsource to a sql statement. Are you sure the statement is correct - can you set the recordsource to a tablename you know exists?
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Jun 25th, 2000, 03:05 AM
#5
I believe you can only use SELECT-type queries with the data control (which I hate to use), not "action" queries, such as INSERT or DELETE. I believe you want to do something like this (this example assumes that "NewTable" and "OldTable" have the same structure):
Code:
Dim MyDB As Database
MyDB.Execute "INSERT INTO NewTable " _
& "SELECT * FROM OldTable " _
& "WHERE OldTable.DateField = #1/1/2000#"
MyDB.Execute "DELETE FROM OldTable " _
& "WHERE OldTable.DateField = #1/1/2000#"
"It's cold gin time again ..."
Check out my website here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|