I am trying to open a report using this code:
DoCmd.OpenReport "rptCustom", acPreview, , "IIf(IsNull([Forms]![frmChooseFields]![chooseflight], ,[Flight] = [Forms]![frmChooseFields]![chooseflight])"
The form has a combobox with 4 different options for flights. When you select one and click the button, it will filter to show only those who are part of that flight. I want to be able to select 'none' and have it show all.
Something is wrong with my statement, but I can't figure it out.
DoCmd.OpenReport "rptCustom", acPreview, , "IIf(IsNull([Forms]![frmChooseFields]![chooseflight], ,[Flight] = [Forms]![frmChooseFields]![chooseflight])"
The form has a combobox with 4 different options for flights. When you select one and click the button, it will filter to show only those who are part of that flight. I want to be able to select 'none' and have it show all.
Something is wrong with my statement, but I can't figure it out.