I have a query with this expression as one of the fields:
Expr1:
IIf(Len([tblSSPbatch]![Batch_Number])=4,Left([tblSSPbatch.Batch_Number],1),IIf(Len([tblSSPbatch]![Batch_Number])=5,Left([tblSSPbatch.Batch_Number],1),IIf(Len([tblSSPbatch]![Batch_Number])=6,Left([tblSSPbatch.Batch_Number],2))))
This expression extracts the vessel number from the batch number.
In the criteria section under the field above I have this:
IIf([Forms]![frmReports]![cboVesselNumber]="*",Like "*" &
[Forms]![frmReports]![cboVesselNumber] &
"*",[Forms]![frmReports]![cboVesselNumber])
This works if cboVesselNumber returns the numbers 1 thru 12 but if
cboVesselNumber returns "*" ,which represents all vessel numbers, then
the query returns zero records.
I can't figure this one out, help!
Thanks,
TD