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] & "*"));
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] & "*"));