I use a technique several times in a user entry form. Multiple users are entering into this form at the same time. The entry gets slower and slower. Is my code shown below causing this slowdown? Thank you.
'Page 248 Access 97 Developer's Handbook:
'Define query parameters passed to query qsel607AccumBTicket
Dim dbs2 As Database
Dim qdf2 As QueryDef
Dim prm2 As Parameter
Dim rst2 As Recordset
Set dbs2 = CurrentDb()
Set qdf2 = dbs2.QueryDefs("qsel607AccumBTicket"
For Each prm2 In qdf2.Parameters
prm2.Value = Eval(prm2.Name)
Next prm2
Set rst2 = qdf2.OpenRecordset(dbOpenDynaset)
'------
With rst2
If rst2.RecordCount > 0 Then
Beep
Msgbox "Invalid material/batch combination. Please check your entry.", vbOKOnly, _
"Invalid material/batch combination"
strError = "Yes"
rst2.Close
DoCmd.OpenForm "frmMaterialBatchErrorsB", acNormal, "qsel607AccumBTicket", "", , acNormal
' cancel the event
DoCmd.CancelEvent
' and stop the macro
Exit Sub
End If
End With
'-----
'Page 248 Access 97 Developer's Handbook:
'Define query parameters passed to query qsel607AccumBTicket
Dim dbs2 As Database
Dim qdf2 As QueryDef
Dim prm2 As Parameter
Dim rst2 As Recordset
Set dbs2 = CurrentDb()
Set qdf2 = dbs2.QueryDefs("qsel607AccumBTicket"
For Each prm2 In qdf2.Parameters
prm2.Value = Eval(prm2.Name)
Next prm2
Set rst2 = qdf2.OpenRecordset(dbOpenDynaset)
'------
With rst2
If rst2.RecordCount > 0 Then
Beep
Msgbox "Invalid material/batch combination. Please check your entry.", vbOKOnly, _
"Invalid material/batch combination"
strError = "Yes"
rst2.Close
DoCmd.OpenForm "frmMaterialBatchErrorsB", acNormal, "qsel607AccumBTicket", "", , acNormal
' cancel the event
DoCmd.CancelEvent
' and stop the macro
Exit Sub
End If
End With
'-----