J
Jim VanGordon
I'm trying to get a way to cut a record from one table
and paste it into another table via a command button on
the form. I posted this problem on the "Forms" string but
I was given an answer that doesn't work because there is
no database variable type (at least not when I try to use
Access 2000)
Here's what I was given (keep in mind that it doesn't
work):
Private Sub Copy_Record_Click()
Dim dbs as datbase
set dbs = currentdb
dbs.execute ("INSERT INTO table2 SELECT table1.* FROM
table1 WHERE table1.criteria ='" & "this record" & "'")
End Sub
This only works if the criteria you are looking for is a
string value. If you criteria is a number value, use this:
dbs.execute ("INSERT INTO table2 SELECT table1.* FROM
table1 WHERE table1.criteria =" & criteria)
TIA
Jim VanGordon
and paste it into another table via a command button on
the form. I posted this problem on the "Forms" string but
I was given an answer that doesn't work because there is
no database variable type (at least not when I try to use
Access 2000)
Here's what I was given (keep in mind that it doesn't
work):
Private Sub Copy_Record_Click()
Dim dbs as datbase
set dbs = currentdb
dbs.execute ("INSERT INTO table2 SELECT table1.* FROM
table1 WHERE table1.criteria ='" & "this record" & "'")
End Sub
This only works if the criteria you are looking for is a
string value. If you criteria is a number value, use this:
dbs.execute ("INSERT INTO table2 SELECT table1.* FROM
table1 WHERE table1.criteria =" & criteria)
TIA
Jim VanGordon