I have a database audit form module that takes a few seconds to search through a linked table and then insert the information into the main db table. I've seen a lot of newsgroup discussions on progress bars and I have a few examples, but they either use a timer or counting records. I'll probable use the simple progress bar with the growing rectangle, but I need help on how to trigger each increment of growth of the popup progress bar, coordinate it with the main form and then close the popup. The code in the main form that executes the database audit is as follows:
Code:
====================================================
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Proc_Err
Dim frmCurrentForm As Form
Dim strUser As String
Dim strFirstName As String
Dim strLastName As String
Set frmCurrentForm = Screen.ActiveForm
frmCurrentForm![LastModified] = NOW
strUser = User()
strFirstName = DLookup("[First]", "Global Address List", "[Account] ='" & strUser & "'")
strLastName = DLookup("[Last]", "Global Address List", "[Account] ='" & strUser & "'")
Me!EditedBy = strFirstName & " " & strLastName
Me!EditedWhen = NOW()
Exit Sub
Proc_Err:
MsgBox "The following error occured: " & Error$
Resume Next
End Sub
====================================================
Thanks,
PC
Code:
====================================================
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Proc_Err
Dim frmCurrentForm As Form
Dim strUser As String
Dim strFirstName As String
Dim strLastName As String
Set frmCurrentForm = Screen.ActiveForm
frmCurrentForm![LastModified] = NOW
strUser = User()
strFirstName = DLookup("[First]", "Global Address List", "[Account] ='" & strUser & "'")
strLastName = DLookup("[Last]", "Global Address List", "[Account] ='" & strUser & "'")
Me!EditedBy = strFirstName & " " & strLastName
Me!EditedWhen = NOW()
Exit Sub
Proc_Err:
MsgBox "The following error occured: " & Error$
Resume Next
End Sub
====================================================
Thanks,
PC