R
Robin
I have a form on which a UserID text box (vUserID) will always have the
current user's initials. On that form (_Main), I have a list box populated
from a query with ClientID, ClientName, ClientType and StaffID. (The User is
always one of the Staff) I would like an option group result (USER = 0 or
ALL = 1) to determine whether the list box shows ALL clients or just the ones
assigned to the USER. I wrote an Iif statement in the StaffID criteria as
follows: IIf (ogClientList = 0, Forms![_Main]![vUserID] , "") This works fine
to filter the list based on the UserID on the form, but when I choose ALL in
the option group the list box goes blank. I know this is because the filter
is now set to show only clients with no StaffID in the Query (due to the "" -
empty string in the "falsepart" of the expression...all Clients have a
StaffID) but I can't figure out how to make it say: if User is chosen in the
Option Group, filter but if All is chosen in the Option Group, don't filter
anything! I'm pretty good with Access and VBA so I should be able to figure
this out! Any help would be appreciated.
current user's initials. On that form (_Main), I have a list box populated
from a query with ClientID, ClientName, ClientType and StaffID. (The User is
always one of the Staff) I would like an option group result (USER = 0 or
ALL = 1) to determine whether the list box shows ALL clients or just the ones
assigned to the USER. I wrote an Iif statement in the StaffID criteria as
follows: IIf (ogClientList = 0, Forms![_Main]![vUserID] , "") This works fine
to filter the list based on the UserID on the form, but when I choose ALL in
the option group the list box goes blank. I know this is because the filter
is now set to show only clients with no StaffID in the Query (due to the "" -
empty string in the "falsepart" of the expression...all Clients have a
StaffID) but I can't figure out how to make it say: if User is chosen in the
Option Group, filter but if All is chosen in the Option Group, don't filter
anything! I'm pretty good with Access and VBA so I should be able to figure
this out! Any help would be appreciated.