I am trying to track projects as they get moved from responsibility center to responsibility center, and eventually run totals on "total days assigned" so we can start to trend where bottlenecks are, and which group has issues for the longest period of time. (the DB is an Access 2007 DB)
So, I have a field called with_group in a table called Issues that is set with a list of the applicable groups for all projects.
On form [Issue Details], I set with_group_AfterUpdate() to try and track all changes and store those changes in a second table called tblWithGroup.
So, this is what I have so far:
So, what I am TRYING to do, quite unsuccessfully
D) is, if there is no start date, like when it is the first time a group is being assigned, have it set the start_date in tblWithGroup to the Open_date in Issues.
Then, on the next change have it 1: put the end_date as Now() on the current record, and then 2: open a new record, assign the group, and the start_date to Now()...and so on and so forth.
As I have said in other posts, I am brand spanking new to Access 2007, and to programming in general, and would like to learn how to do this kind of thing, so any help is greatly appreciated!
So, I have a field called with_group in a table called Issues that is set with a list of the applicable groups for all projects.
On form [Issue Details], I set with_group_AfterUpdate() to try and track all changes and store those changes in a second table called tblWithGroup.
So, this is what I have so far:
Code:
Private Sub with_group_AfterUpdate()
On Error GoTo errline
Stop
If tblWithGroup.Start_Date = Null Then
tblWithGroup.Start_Date = Me.Opened_Date
End If
.Update
!tblWithGroup.End_Date = Now()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblWithGroup")
With rs
.AddNew
!Issue_ID = Me.ID
!Group = Me.with_group
!Start_Date = Now()
.Update
End With
If Not rs Is Nothing Then
rs.Close
Set rs = Nothing
End If
Exit Sub
So, what I am TRYING to do, quite unsuccessfully
Then, on the next change have it 1: put the end_date as Now() on the current record, and then 2: open a new record, assign the group, and the start_date to Now()...and so on and so forth.
As I have said in other posts, I am brand spanking new to Access 2007, and to programming in general, and would like to learn how to do this kind of thing, so any help is greatly appreciated!