Creating a log file from actions taken in a form
I have created a form where users select a start range, end range and a adjusting value. They would then click on a "GO" button, an a update query will modify the value of the selected range by the adjusting value. I would like to keep track of the changes made by the users by appending the starting range, end range, adjustment value and date in a log file.
I have come up with the following code but I keep getting a "No current record." error.
Dim wrkDefault As Workspace
Dim dbs As Database
Dim rst As Recordset
Set wrkDefault = DBEngine.Workspaces(0)
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("PrinterNumberConversionLog")
wrkDefault.BeginTrans
With rst
.AddNew
!LogAdjustedDate = Date
!LogStartingRange = [Forms]![AAA-4to7DigitForm]![StartRange]
!LogEndingRange = [Forms]![AAA-4to7DigitForm]![EndRange]
!LogAdjustmentBy = [Forms]![AAA-4to7DigitForm]![AdjustBy]
.Update
.MoveNext
End With
wrkDefault.CommitTrans
dbs.Close
Thanks.
[LGuzman]
__________________
[LGuzman]
|