lone_rider15
Registered User.
- Local time
- Today, 11:07
- Joined
- Nov 6, 2016
- Messages
- 32
[FONT="]Background: I have an application with back end SQL Server 2014 and front end in Access. In the attached screenshot I am on the “Begin Review” form. The record source of the form is a linked table. The record comes in review if the “Audit Status” field value is “Assigned”. The “Complete” button runs a pass through query to run a stored procedure. The stored procedure updates a record’s “Audit Status” to “Assigned”. The stored procedure gets executed within less than a second.
[/FONT][FONT="]Problem: Every time I navigate to any places (for example – Dashboard) and come back to “Begin Review” and click on “Complete” button for the first time the stored procedure runs within less than a second but the application stays busy for more than 30 seconds. From the second click on “Complete” button until I navigate to any places again every time the process takes less than a second.
[/FONT][FONT="]Looking for solution: Reduce or if possible eradicate the busy (loading) 30 seconds time.
[/FONT] The code behind the form follows:
Private Sub Form_Load()
Call AssignReview
End Sub
Private Sub AssignReview()
Dim rst As Object
Set rst = Me.RecordsetClone
Me.Requery
If rst.EOF Or rst.RecordCount <= 1 Then
DoCmd.SetWarnings False
Call ModifyqryPassMarsQcInquiryAssign
DoCmd.SetWarnings True
Me.Requery
End If
End Sub
Private Sub ModifyqryPassMarsQcInquiryAssign()
Dim strSQL As String
Dim qdf As DAO.QueryDef
strSQL = "EXEC spMarsQcQueue '" & Forms(frmLogin)!txtUserId & "'"
Set qdf = CurrentDb.QueryDefs("qryPassMarsQcInquiryAssign")
qdf.SQL = strSQL
qdf.Execute
Set qdf = Nothing
End Sub
'------------------------------------------------------------
' cmdComplete_Click
'------------------------------------------------------------
Private Sub cmdComplete_Click()
On Error GoTo cmdComplete_Click_Err
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord
Call AssignReview
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
cmdComplete_Click_Exit:
Exit Sub
cmdComplete_Click_Err:
MsgBox Error$
Resume cmdComplete_Click_Exit
End Sub
[/FONT][FONT="]Problem: Every time I navigate to any places (for example – Dashboard) and come back to “Begin Review” and click on “Complete” button for the first time the stored procedure runs within less than a second but the application stays busy for more than 30 seconds. From the second click on “Complete” button until I navigate to any places again every time the process takes less than a second.
[/FONT][FONT="]Looking for solution: Reduce or if possible eradicate the busy (loading) 30 seconds time.
[/FONT] The code behind the form follows:
Private Sub Form_Load()
Call AssignReview
End Sub
Private Sub AssignReview()
Dim rst As Object
Set rst = Me.RecordsetClone
Me.Requery
If rst.EOF Or rst.RecordCount <= 1 Then
DoCmd.SetWarnings False
Call ModifyqryPassMarsQcInquiryAssign
DoCmd.SetWarnings True
Me.Requery
End If
End Sub
Private Sub ModifyqryPassMarsQcInquiryAssign()
Dim strSQL As String
Dim qdf As DAO.QueryDef
strSQL = "EXEC spMarsQcQueue '" & Forms(frmLogin)!txtUserId & "'"
Set qdf = CurrentDb.QueryDefs("qryPassMarsQcInquiryAssign")
qdf.SQL = strSQL
qdf.Execute
Set qdf = Nothing
End Sub
'------------------------------------------------------------
' cmdComplete_Click
'------------------------------------------------------------
Private Sub cmdComplete_Click()
On Error GoTo cmdComplete_Click_Err
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord
Call AssignReview
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
cmdComplete_Click_Exit:
Exit Sub
cmdComplete_Click_Err:
MsgBox Error$
Resume cmdComplete_Click_Exit
End Sub
Attachments
Last edited: