I have a main form that houses a subform. If I click a value in the subform, it will filter the main form to that value. However, my Access has been crashing (starting today) when I perform this action, and I'm thinking it may possibly related to the VBA I have performing this filter action. See my code below. This was working without issue the last few days, but today it began crashing without any updates to my code at all.
Code:
Dim strFilter As String On Error GoTo ErrHandler
'If the clicked text box has a value, then filter my main form to the record matching the clicked value
If Forms![Load Planning]![DailyFile subform].Form!Text14.Text <> "" Then
strFilter = "[Order Line Key] Like '*" & Forms![Load Planning]![DailyFile subform].Form!Text14.Text & "*'"
Forms![Load Planning].Filter = strFilter
Forms![Load Planning].FilterOn = True
Else
Forms![Load Planning].Filter = ""
Forms![Load Planning].FilterOn = False
End If
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation
DoCmd.SetWarnings (WarningsOn)
By crashing, I mean that I get the popup telling me to search for a solution online or restart Access. No other error messages appear.