Here's the SQL for the query. When I include the IIF statement into the WHERE clause, it doesn't return any records (even though it should). I'm guessing it has something to do with how the statement is organized, but I'm not sure.
Code:
SELECT Tbl_RMS_Current_Day.[ACCOUNT NUMBER], Tbl_RMS_Current_Day.NAME
FROM Tbl_RMS_Current_Day
WHERE (((Tbl_RMS_Current_Day.[ACCOUNT NUMBER])=IIf([Forms]![frm_Search]![frameButtonGroup]=1,([Tbl_RMS_Current_Day].[ACCOUNT NUMBER]) Like "*" & "505" & "*")));