Edit: I now realize that's not my only problem with this setup. I'm trying to make it so the form will filter out any records that do not contain the filter set by item_in_a_textbox but the item could be in any of 10 fields.
I've got a table with I1-I10 as fields and I was attempting to run a search through the fields for a specific word. I'm not sure what I'm missing but I can't get it to recognize a string.
Code:
do while i < 11
istr = "I" & i
if [istr] = me.item_in_a_text_box then
strFilter = strFilter & "([istr] = """ & Item & """)"
end if
i = i + 1
Loop
Edit40: I fixed it by just putting 10 filters in (with a do while loop):
Code:
do while i < 11
istr = "I" & i
strFilter = strFilter & "([" & istr & "] = """ & Item & """) OR "
end if
i = i + 1
Loop