Imdabaum
09-30-2010, 03:44 PM
Before I leave to play with voice recognition, I have one last request that just came through from my manager.
We have a projects database. For the most part it is to keep us from duplicating work for the company, we can always track the requirements and goals and tell the user, "No that's already been done, please go here to access this utility." However, some of these projects require Help Files. In these instances, I've been requested to copy specific data from the record and create a new record based on it.
I'm struggling with the Bookmark concept. I want to bookmark the record I'm currently in. Then I want to go to a new record set the data and return to the record I was at, not just the one before it as my searches are turning up on google. I mean semantically previous does not always equal the 'one' before.
So far I have this.
'.....
lRecID = Me.PL_ID
DoCmd.Hourglass True
If (CreateHelpFileProject(Me.AssignmentTitle, Me.ReqName, #9/30/2010#, Me.ProjectRequirements)) Then
CreateNotification Me.PL_ID, Me.AsnEmail, Me.txtAsnDate, Me.ProjectRequirements, NeedsHF
Else
MsgBox "Notifcation cannot be sent because there are no requirements for this project."
End If
DoCmd.Hourglass False
DoCmd.FindRecord "[PL_ID]= " & lRecID
'......
End Sub
Private Function CreateHelpFileProject(sTitle As String, _
sRName As String, _
dAsnDate As Date, _
sRequirements As String) As Boolean
On Error GoTo Err_Handler
Dim sSQL As String
sTitle = "Help File for " & sTitle
'Create new Help file record
DoCmd.RunCommand acCmdRecordsGoToNew
Me.AssignmentTitle = sTitle
Me.cboReqName = sRName
Call cboReqName_Click
Me.AsnDate = Format(dAsnDate, "Short Date")
Me.cboAssignTo = "MARY"
Call cboAssignTo_AfterUpdate
Me.ProjectRequirements = sRequirements
Me.cboProjectType = "Helpfile"
DoCmd.RunCommand acCmdSaveRecord
CreateHelpFileProject = True
Exit_Proc:
Exit Function
Err_Handler:
CreateHelpFileProject = False
MsgBox Err.Description, vbInformation, "Error: " & Err.Number
Resume Exit_Proc
End Function
We have a projects database. For the most part it is to keep us from duplicating work for the company, we can always track the requirements and goals and tell the user, "No that's already been done, please go here to access this utility." However, some of these projects require Help Files. In these instances, I've been requested to copy specific data from the record and create a new record based on it.
I'm struggling with the Bookmark concept. I want to bookmark the record I'm currently in. Then I want to go to a new record set the data and return to the record I was at, not just the one before it as my searches are turning up on google. I mean semantically previous does not always equal the 'one' before.
So far I have this.
'.....
lRecID = Me.PL_ID
DoCmd.Hourglass True
If (CreateHelpFileProject(Me.AssignmentTitle, Me.ReqName, #9/30/2010#, Me.ProjectRequirements)) Then
CreateNotification Me.PL_ID, Me.AsnEmail, Me.txtAsnDate, Me.ProjectRequirements, NeedsHF
Else
MsgBox "Notifcation cannot be sent because there are no requirements for this project."
End If
DoCmd.Hourglass False
DoCmd.FindRecord "[PL_ID]= " & lRecID
'......
End Sub
Private Function CreateHelpFileProject(sTitle As String, _
sRName As String, _
dAsnDate As Date, _
sRequirements As String) As Boolean
On Error GoTo Err_Handler
Dim sSQL As String
sTitle = "Help File for " & sTitle
'Create new Help file record
DoCmd.RunCommand acCmdRecordsGoToNew
Me.AssignmentTitle = sTitle
Me.cboReqName = sRName
Call cboReqName_Click
Me.AsnDate = Format(dAsnDate, "Short Date")
Me.cboAssignTo = "MARY"
Call cboAssignTo_AfterUpdate
Me.ProjectRequirements = sRequirements
Me.cboProjectType = "Helpfile"
DoCmd.RunCommand acCmdSaveRecord
CreateHelpFileProject = True
Exit_Proc:
Exit Function
Err_Handler:
CreateHelpFileProject = False
MsgBox Err.Description, vbInformation, "Error: " & Err.Number
Resume Exit_Proc
End Function