I have 4 textboxes for users to enter data and then search a database for those 4 criteria. However I don't know how to remove a criteria if the user does not fill it in. Here is the linkcriteria i am using, it works when all the criteria is provided:
stLinkCriteria = "[SLA Number]=" & "'" & varHIN & "'" & " And " & "[RO Number]=" & "'" & varRO & "'" & " And " & "[ISS Contact]=" & "'" & varISS & "'" & "And " & "[Client Name]=" & "'" & varClient & "'"
I tried an "IF IsNull" statement, but that would require putting data for each combination of Null and non-Null values for the 4 criteria.
Is there a wildcard function in
vb? I was thinking I could assign that to a criteria if there was a null value there.
Essentially i'd like a statement like this (1, 2, 3, 4 are variables):
stlinkcriteria = 1 and 2 and 3 and 4
ONLY IF 1, 2, 3, 4 are NOT null values.