Ranman256
Well-known member
- Local time
- Today, 16:23
- Joined
- Apr 9, 2015
- Messages
- 4,353
Here is my example of a user pick list. The user can pick items from a list (dbl-click) the items are added to a Picked list table.
This table can be joined to the main table to pull ONLY the items chosen. (rather than have a query with many OR clauses)
It also has filters by Letter or State to help speed up selections.
below are the queries/events that go with the various controls...
qsNames1Ltr:
select [name], [state] from tClients where [name] like "*" & forms!frmPick!lstAlf & "*"
qsAvail:
select [name], [state] from tClients
qs1State:
select [name], [state] from tClients where [state] = forms!frmPick!lstState
qsPicked:
select * from tPicked
qaAddPickedPerson:
INSERT INTO tPicked ( Name, State )
SELECT [Name] ,[State] FROM tClients
WHERE ((ClientID)=[Forms]![frmPick]![lstAvail)
qdEmptyPikTbl:
DELETE * FROM tPicked
qdDel1Person:
DELETE * FROM tPicked where [name] = forms!frmPick!lstPicked

This table can be joined to the main table to pull ONLY the items chosen. (rather than have a query with many OR clauses)
It also has filters by Letter or State to help speed up selections.
below are the queries/events that go with the various controls...
qsNames1Ltr:
select [name], [state] from tClients where [name] like "*" & forms!frmPick!lstAlf & "*"
qsAvail:
select [name], [state] from tClients
qs1State:
select [name], [state] from tClients where [state] = forms!frmPick!lstState
qsPicked:
select * from tPicked
qaAddPickedPerson:
INSERT INTO tPicked ( Name, State )
SELECT [Name] ,[State] FROM tClients
WHERE ((ClientID)=[Forms]![frmPick]![lstAvail)
qdEmptyPikTbl:
DELETE * FROM tPicked
qdDel1Person:
DELETE * FROM tPicked where [name] = forms!frmPick!lstPicked
