Access (XP) crashes on after update of combo box

  • Thread starter Thread starter Nick X
  • Start date Start date
N

Nick X

Hi all,
is there anything about the code below that would make access crash?

Private Sub cboStreetNames_AfterUpdate()
' Find the record that matches the control.

On Error GoTo cboStreetNames_AfterUpdate_Err

If chkAllUT = True Then
'MsgBox "Show Filtered"
DoCmd.ShowAllRecords
Me.Requery
DoCmd.ApplyFilter "qSearchStreet", "JobID = " & Me.JobID
Me.cboStreetNames.Requery
Else
'MsgBox "Show All"
DoCmd.ShowAllRecords
Me.Requery
DoCmd.ApplyFilter "qSearchStreet"
Me.cboStreetNames.Requery
End If

cboStreetNames = ""
chkAllUT = False
DoCmd.GoToControl "cboStreetNames"

cboStreetNames_AfterUpdate_Exit:
Exit Sub

cboStreetNames_AfterUpdate_Err:
MsgBox Error$
Resume cboStreetNames_AfterUpdate_Exit

End Sub

qSearchStreet:
SELECT tblCuts.Address1, tblCuts.StreetName, tblCuts.From, tblCuts.To,
tblCuts.JobID, *
FROM tblUtilities INNER JOIN tblCuts ON tblUtilities.KeyID = tblCuts.JobID
WHERE (((tblCuts.Address1) Like "*" & [Forms].[fCuts].[cboStreetNames] &
"*")) OR (((tblCuts.StreetName) Like "*" & [Forms].[fCuts].[cboStreetNames] &
"*")) OR (((tblCuts.From) Like "*" & [Forms].[fCuts].[cboStreetNames] & "*"))
OR (((tblCuts.To) Like "*" & [Forms].[fCuts].[cboStreetNames] & "*"));
 
ps: This does not crash if connected to network (running on laptop), will
work if network connected when DB opened and then laptop disconnected from
network, when disconected from network the form opens and says "disk error"
 
Back
Top