alastair69
Registered User.
- Local time
- Today, 08:35
- Joined
- Dec 21, 2004
- Messages
- 562
Hello All,
I have successfully coded a button to copy one line of data, i need to be able to copy any selected records, but i am not sure how to go about this, i have included the coding that i am currently using.
The form is a continuse form.
The Code Is:
Private Sub cmd_Update_Table_Click()
Dim db As Database
'Dim rs As Recordset
Dim frm As Form
Set db = CurrentDb() 'keeping in mind your table is within the same database
Set rs = db.OpenRecordset("tbl Samples")
If [Form]![frm Export]![Chk_ExportTable] = True Then
rs.AddNew
rs!ReportNumber = ReportNumber
rs!SampleNumber = [Form]![frm Export]!Sample
rs.Update
rs.Close
Me.Refresh
MsgBox "RECORD SUCCESSFULLY UPDATED", vbOKOnly, "SAVE INFORMATION"
End If
End Sub
any help or advice will be taken on board and used.
Kind Regards
Alastair
I have successfully coded a button to copy one line of data, i need to be able to copy any selected records, but i am not sure how to go about this, i have included the coding that i am currently using.
The form is a continuse form.
The Code Is:
Private Sub cmd_Update_Table_Click()
Dim db As Database
'Dim rs As Recordset
Dim frm As Form
Set db = CurrentDb() 'keeping in mind your table is within the same database
Set rs = db.OpenRecordset("tbl Samples")
If [Form]![frm Export]![Chk_ExportTable] = True Then
rs.AddNew
rs!ReportNumber = ReportNumber
rs!SampleNumber = [Form]![frm Export]!Sample
rs.Update
rs.Close
Me.Refresh
MsgBox "RECORD SUCCESSFULLY UPDATED", vbOKOnly, "SAVE INFORMATION"
End If
End Sub
any help or advice will be taken on board and used.
Kind Regards
Alastair