how to reduce the code lines

That starts to get complicated because now the second AND operator is dependent on content of more than 1 control. But I just remembered a simpler syntax.

"[fgk] LIKE " & Nz(.Text25, "'*'") & " AND [S_Active] LIKE '" & Nz(.Text5, "*") & "' AND [S_Type] LIKE '" & Nz(.Text13, "*") & "'"

The first approach can be useful for concatenating fields such as name parts and want to avoid extra spaces or comma when a name part, such as middle name, is not present.

Hi June7, That was great, thank you for spend your time for me.
 

Users who are viewing this thread

Back
Top Bottom