Solved Hiding a Specific Entry from Combo Box? (1 Viewer)

Pac-Man

Active member
Local time
Tomorrow, 01:12
Joined
Apr 14, 2020
Messages
408
Hi,

cboUsers get lost if users through SQL statement from a table tblUser. How can I hide a specific user from cboUsers do that it don't show up in the list.

Best Regards
Abdullah
 

June7

AWF VIP
Local time
Today, 12:12
Joined
Mar 9, 2014
Messages
5,423
Use an SQL statement with filter criteria as RowSource. Something like:

SELECT UserID FROM tblUsers WHERE UserID <> some number;
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:12
Joined
Sep 21, 2011
Messages
14,047
Or put a flag in the tblUser to indicate which users you should show.?
 

Pac-Man

Active member
Local time
Tomorrow, 01:12
Joined
Apr 14, 2020
Messages
408
Or put a flag in the tblUser to indicate which users you should show.?
Although my question is answered and resolved (as suggested by @June7 in post # 2) but just for information and out of curiosity, can you explain a bit more because I dont about flags and how to put flag in table.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:12
Joined
Sep 21, 2011
Messages
14,047
Although my question is answered and resolved (as suggested by @June7 in post # 2) but just for information and out of curiosity, can you explain a bit more because I dont about flags and how to put flag in table.
A 'flag' is just a term to signify something? It just flags up how a particular set of data should be processed.?
You could have a field with Y or N in it called ShowUser and then only select those records that have a Y in that field. It could be boolean?
It is just some method to identify records for a partcicular process.

The benefit would be, if you decide another user should not be shown, you at the moment have to amend code.
If you put the choice into a table then no code needs to be amended when the requirement is?

As you already have a table for users, it would just be another field.

HTH
 

Pac-Man

Active member
Local time
Tomorrow, 01:12
Joined
Apr 14, 2020
Messages
408
A 'flag' is just a term to signify something? It just flags up how a particular set of data should be processed.?
You could have a field with Y or N in it called ShowUser and then only select those records that have a Y in that field. It could be boolean?
It is just some method to identify records for a partcicular process.

The benefit would be, if you decide another user should not be shown, you at the moment have to amend code.
If you put the choice into a table then no code needs to be amended when the requirement is?

As you already have a table for users, it would just be another field.

HTH
Thanks a lot for explaining. I understood now. It's great to control the form row source from within table. Thanks again.
 

Users who are viewing this thread

Top Bottom