Hi,
(I'm using Windows 7, Access 2010 - have updated in my settings but isn't showing on this post as yet)
I've come across this thread as I am trying to do exactly the same - I'm hitting the same problem as the original poster and I'm at around post number #11.
I have two tables: tblLocations and my archive table tblRemovedSamples. I'm wanting to use a button on a form to move the selected record to the archive table. All field names are the same, my ID field is numerical.
My code is below:
Code:
Private Sub btnRemoveSample_Click()
Dim strSQL As String
strSQL = "INSERT INTO tblRemovedSamples ( ID, Cryostat, Column_No, Drawer, Slot, Sample_ID, Cap_Colour, Date_Cryopreserved, Cryopreserved_User, Storage_User, Notes ) "
strSQL = strSQL + " SELECT tblLocation.ID, tblLocation.Cryostat, tblLocation.Column_No, tblLocation.Drawer, tblLocation.Slot, tblLocation.Sample_ID, tblLocation.Cap_Colour, tblLocation.Date_Cryopreserved, tblLocation.Cryopreserved_User, tblLocation.Storage_User, tblLocation.Notes "
strSQL = strSQL + " WHERE tblRemovedSamples.ID= )" & Me.ID
DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings False
DoCmd.SetWarnings True
End Sub
I'm getting error message:
"Run-time error '3075':
Syntax error (missing operator) in query expression 'tblLocation.Notes WHERE tblRemovedSamples.ID =)1'."
I'm also a novice with Access - any help really appreciated as I'm getting to the point where I can't even see the code properly for staring at it!