I have a main form that has a search section based off of unbound text boxes.
When the filter button is clicked the following executes:
Code:
sWhere = "1=1"
If Not IsNull(Me.txtCode) Then sWhere = sWhere & " and Left([MAINFR_SER_NO],3)='" & Me.txtCode & "'"
If Not IsNull(Me.txtCarrier) Then sWhere = sWhere & " and [SUB_LOC_CD]='" & Me.txtCarrier & "'"
If Not IsNull(Me.txtMCode) Then sWhere = sWhere & " and [MKT_CD] Like '*" & Me.txtMCode & "*'"
It works perfectly and all of the search fields are on the main form.
I would like to add another unbound text box that searches a subform. I tried this but I get Object Required error:
Code:
If Not IsNull(USED_Form_Main.txtACode) Then sWhere = sWhere & " and [SUBFORM_ACCESSORY].[ACC] Like '*" & USED_Form_Main.txtACode & "*'"
txtACode is the unbound text box on the main form and ACC is the field I would like to search on the SUBFORM_ACCESSORY subform
Any help would be appreciated