mike60smart
Registered User.
- Local time
- Today, 21:28
- Joined
- Aug 6, 2017
- Messages
- 2,177
Hi
I have a Continuous Form and want to be able to use the record selector to select
a specific record and then Insert/Append that record to another table.
How would I modify the attached example code to achieve this?
****Edit
I know I must amend this line :-
If Me.Updated = True Then
But to what? How do I specifiy the current record selected in VBA???
I have a Continuous Form and want to be able to use the record selector to select
a specific record and then Insert/Append that record to another table.
How would I modify the attached example code to achieve this?
Code:
Private Sub cmdInsert_Click()
Dim dbsMydbs As DAO.Database
Dim rstMyTable As DAO.Recordset
If Me.Updated = True Then
Me.Dirty = False
Set dbsMydbs = CurrentDb
Set rstMyTable = dbsMydbs.OpenRecordset("tblBankPaymentHistory")
With rstMyTable
.AddNew
!MembershipNrID = Me.MembershipID
!MemNo = Me.MemNo
!AmountPaid = Me.Subs
!DatePaid = Now()
.Update
End With
MsgBox "Members Payments have been added.", vbInformation, "Complete"
Else
MsgBox "No Payments have been added.", vbInformation, "InComplete"
End If
rstMyTable.Close
Set rstMyTable = Nothing
Set dbsMydbs = Nothing
End Sub
****Edit
I know I must amend this line :-
If Me.Updated = True Then
But to what? How do I specifiy the current record selected in VBA???
Last edited: