MackMan
Registered User.
- Local time
- Today, 03:17
- Joined
- Nov 25, 2014
- Messages
- 174
Hi Everyone.
I've been using Allen Browns method http://allenbrowne.com/ser-57.html to copy form and sub form data, and it works perfectly after some adaptation.
It changes dates to today from whatever the date 'was'.. perfect....
however, as I'm still learning SQL, is there a way, to make the copied subform's date into today as well... this is my adapted code from the SQL part...
As I'm still learning, am I right in thinking that I'll use SELECT and/or WHERE somewhere in there?
As always, many thanks!
I've been using Allen Browns method http://allenbrowne.com/ser-57.html to copy form and sub form data, and it works perfectly after some adaptation.
It changes dates to today from whatever the date 'was'.. perfect....
however, as I'm still learning SQL, is there a way, to make the copied subform's date into today as well... this is my adapted code from the SQL part...
Code:
'Duplicate the related records: append query.
If Forms!FRMREGISTERMain!frmJustSubRecordsDEPOSITS.Form.RecordsetClone.RecordCount > 0 Then
strSql = "INSERT INTO [tblSplits] ( TopLineID, [B][I][COLOR=red]TransDate[/COLOR][/I][/B], Memo, Category, SubCategory, Credit, Debit) " & _
"SELECT " & lngID & " As NewID, [B][I][COLOR=red]TransDate[/COLOR][/I][/B], Memo, Category, SubCategory, Credit, Debit " & _
"FROM [tblSplits] WHERE TopLineID = " & Me.TopLineID & ";"
DBEngine(0)(0).Execute strSql, dbFailOnError
Else
MsgBox "Main Transaction has been Copied, but as this is not a Split, there was no other details."
End If
As always, many thanks!