gakiss2
Registered User.
- Local time
- Yesterday, 22:40
- Joined
- Nov 21, 2018
- Messages
- 168
I am using ColumnHistory to keep track of changes to a form. When a control on the form is changed then a sub is called to add an entry to the Note field.
The code is very simple:
Here is some code of the sub being called, again very simple
As far as the detail of what is put into the Note field, all is working very well.
I should mention that I didn't like the long tag so I shortened it by getting rid of "Version:" by using this expression for the field:
=Replace(ColumnHistory("tblDocsIssued","Note","[ID]=" & Nz([ID],0)),"[Version:","")
that works too. It isn't code per se, it is entered in the properties for the Note field.
Form in Design View:
The problem is that the entries displayed in the control are meant to be in chronological order but the are not. It is difficult to describe. The individual lines seemed to be 'clumped' but the clumps are not in order. I haven't been able to discern any 'logic' to the order the history lines are presented in. Below is an image showing the 'clumped' incorrect order.
This seems to happen to most records. The lines start at the top if you open an existing form (made before today's date). If you make a new form then they are listed top to bottom as they are added. If you open that new form again, on the same day, then new lines add to the bottom as expected. But even that doesn't explain that sometimes the new added to an existing sometimes start in the middle somewhere.
Is there a setting or some code I can use so that the lines of history are presented in the order they are recorded?? Old to new top to bottom. I would actually prefer the reverse order, new on top. But getting it in some logical order is the first order of business.
Thanks for all the help.
The code is very simple:
Code:
Public Sub AddHistory(frmControl As Control, ctlName)
Forms("frmDocDetail").Note = ctlName & " Changed to " & frmControl & " by " & Environ("Username")
Forms("frmDocDetail").Refresh
' fTabNextControl
Forms("frmDocDetail").Note = ""
End Sub
Code:
Private Sub PartNum_AfterUpdate()
Call AddHistory(PartNum, "Part Number")
End Sub
As far as the detail of what is put into the Note field, all is working very well.
I should mention that I didn't like the long tag so I shortened it by getting rid of "Version:" by using this expression for the field:
=Replace(ColumnHistory("tblDocsIssued","Note","[ID]=" & Nz([ID],0)),"[Version:","")
that works too. It isn't code per se, it is entered in the properties for the Note field.
Form in Design View:
The problem is that the entries displayed in the control are meant to be in chronological order but the are not. It is difficult to describe. The individual lines seemed to be 'clumped' but the clumps are not in order. I haven't been able to discern any 'logic' to the order the history lines are presented in. Below is an image showing the 'clumped' incorrect order.
This seems to happen to most records. The lines start at the top if you open an existing form (made before today's date). If you make a new form then they are listed top to bottom as they are added. If you open that new form again, on the same day, then new lines add to the bottom as expected. But even that doesn't explain that sometimes the new added to an existing sometimes start in the middle somewhere.
Is there a setting or some code I can use so that the lines of history are presented in the order they are recorded?? Old to new top to bottom. I would actually prefer the reverse order, new on top. But getting it in some logical order is the first order of business.
Thanks for all the help.