G
Guest
Hi:
I have a query that takes a while to run. I would like to display a form
while it is compiling so that the users do not think the system has frozen.
I am having trouble with an IsLoaded statement..........
I have written the following code:
Private Sub cmdCloseSplash_Click()
On Error GoTo Err_cmdCloseSplash_Click
Dim stDocName As String
DoCmd.Close
'Expiry Check takes a while, display form while waiting
DoCmd.OpenForm "frmExpiryStatus"
'Expiry Check
stDocName = "rptExpiry"
If frmExpiryStatus.IsLoaded = True Then
DoCmd.Close acForm, "frmExpiryStatus"
End If
If IsNull(DLookup("strDispositionNumber", "qryExpiry")) Then
MsgBox "Expiry Check OK. Preview cancelled", vbInformation
Else
DoCmd.OpenReport stDocName, acViewPreview
DoCmd.Maximize
MsgBox "Pending Expiration Dates require your attention",
vbInformation
End If
Exit_cmdCloseSplash_Click:
Exit Sub
Err_cmdCloseSplash_Click:
MsgBox Err.Description
Resume Exit_cmdCloseSplash_Click
End Sub
I am getting a message box that just says "Object Required" and my form
frmExpiryStatus stays open.
I'm not very good with efficient with code so any suggestions would be
awesome.
Thanks
I have a query that takes a while to run. I would like to display a form
while it is compiling so that the users do not think the system has frozen.
I am having trouble with an IsLoaded statement..........
I have written the following code:
Private Sub cmdCloseSplash_Click()
On Error GoTo Err_cmdCloseSplash_Click
Dim stDocName As String
DoCmd.Close
'Expiry Check takes a while, display form while waiting
DoCmd.OpenForm "frmExpiryStatus"
'Expiry Check
stDocName = "rptExpiry"
If frmExpiryStatus.IsLoaded = True Then
DoCmd.Close acForm, "frmExpiryStatus"
End If
If IsNull(DLookup("strDispositionNumber", "qryExpiry")) Then
MsgBox "Expiry Check OK. Preview cancelled", vbInformation
Else
DoCmd.OpenReport stDocName, acViewPreview
DoCmd.Maximize
MsgBox "Pending Expiration Dates require your attention",
vbInformation
End If
Exit_cmdCloseSplash_Click:
Exit Sub
Err_cmdCloseSplash_Click:
MsgBox Err.Description
Resume Exit_cmdCloseSplash_Click
End Sub
I am getting a message box that just says "Object Required" and my form
frmExpiryStatus stays open.
I'm not very good with efficient with code so any suggestions would be
awesome.
Thanks