Hey there all,
I have a form that I use to close helpdesk tickets that calculates the time spent on the ticket. I decided a few weeks ago to allow the users to have all the forms in the database be pop ups instead of the normal form. This allows the user to shrink the Database window down and use the forms as if they were windows on the desktop. However when I did this the On Activate property stopped working. the code I was using is
Private Sub cmdClsTkt_Click()
On Error GoTo Err_cmdClsTkt_Click
TimeSpent = txtMin
CloseIssue = 1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.Close
Exit_cmdClsTkt_Click:
Exit Sub
Err_cmdClsTkt_Click:
MsgBox Err.Description
Resume Exit_cmdClsTkt_Click
End Sub
Private Sub cmdCancel_Click()
On Error GoTo Err_cmdCancel_Click
CloseIssue = 1
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
Exit_cmdCancel_Click:
Exit Sub
Err_cmdCancel_Click:
MsgBox Err.Description
Resume Exit_cmdCancel_Click
End Sub
Private Sub Form_Activate()
DTClosed = Now()
txtMin = DateDiff("n", [DTStart], [DTClosed])
End Sub
I can put a command button in that will do the calculating for us but I would prefer the auto calculation that I had before.
Any Ideas?
Krash
I have a form that I use to close helpdesk tickets that calculates the time spent on the ticket. I decided a few weeks ago to allow the users to have all the forms in the database be pop ups instead of the normal form. This allows the user to shrink the Database window down and use the forms as if they were windows on the desktop. However when I did this the On Activate property stopped working. the code I was using is
Private Sub cmdClsTkt_Click()
On Error GoTo Err_cmdClsTkt_Click
TimeSpent = txtMin
CloseIssue = 1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.Close
Exit_cmdClsTkt_Click:
Exit Sub
Err_cmdClsTkt_Click:
MsgBox Err.Description
Resume Exit_cmdClsTkt_Click
End Sub
Private Sub cmdCancel_Click()
On Error GoTo Err_cmdCancel_Click
CloseIssue = 1
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
Exit_cmdCancel_Click:
Exit Sub
Err_cmdCancel_Click:
MsgBox Err.Description
Resume Exit_cmdCancel_Click
End Sub
Private Sub Form_Activate()
DTClosed = Now()
txtMin = DateDiff("n", [DTStart], [DTClosed])
End Sub
I can put a command button in that will do the calculating for us but I would prefer the auto calculation that I had before.
Any Ideas?
Krash