I’m trying to populate a list box ‘List2’ on a form ‘Frm_Alloc’ that’s bound to ‘Tbl_Referral with records that that are dependant on a combo box ‘CmbSite’ on a main menu ‘Frm_MMenu’.
If CmbSite is populated then I want the List2 to show the related records that match (Tb_Ref has a matching field called SiteName) otherwise if CbmSite is empty (nothing selected) then I want all the records in Tbl_Ref to be displayed in List2.
I thought the IIf Fuction in the Row Source query of List2 would do the trick but I seem to be having problems with the True part.
IIf(IsNull([Forms]![Frm_MMenu]![CmbSite]),([Tbl_Referral].[SiteName]) Like "*",[Forms]![Frm_MMenu]![CmbSite])
I’d be grateful for any help.
If CmbSite is populated then I want the List2 to show the related records that match (Tb_Ref has a matching field called SiteName) otherwise if CbmSite is empty (nothing selected) then I want all the records in Tbl_Ref to be displayed in List2.
I thought the IIf Fuction in the Row Source query of List2 would do the trick but I seem to be having problems with the True part.
IIf(IsNull([Forms]![Frm_MMenu]![CmbSite]),([Tbl_Referral].[SiteName]) Like "*",[Forms]![Frm_MMenu]![CmbSite])
I’d be grateful for any help.