I prefer to do this by using VBA to control the
.Filter and
.FilterOn Properties of the Form instead of building the criteria into the Query itself.
That said, you can do what you want by wrapping your current condition in an IIf() Statement:
Code:
Like IIf([Forms]![MyForm]![chkFilterBookType]=True,[Forms]![MyForm]![cboBookType] & "*","*")
In this example,
chkFilterBookType is a Checkbox Control that enables or disables filtering by book type and
cboBookType is the Combo Box Control listing the book types you can filter by.
Adding the IIf() Statement allows you to change the condition based on the value of chkFilterBookType. If it's checked (True), then the condition Filters on the condition
Like [Forms]![MyForm]![cboBookType] & "*" (which only includes items beginning with the value of your Combo Box Control).
If it's not checked (False), then it instead, Filters on the condition
Like "*" (which would include everything).