Solved Two listboxes remove selections if used (1 Viewer)

oxicottin

Learning by pecking away....
Local time
Today, 04:07
Joined
Jun 26, 2007
Messages
856
Hello, I have two listboxes (CrewOneDelimitedEmployees) and (CrewTwoDelimitedEmployees) using the same employee list to select from. I want to be able to if I select data from (CrewOneDelimitedEmployees) then it should remove the selection from (CrewTwoDelimitedEmployees) so I can't select same data.

I figured I could in each listboxes row source add under the criteria a "Not In" for the empID but how?

Something like but doesnt work:

Not In (SELECT EmpID FROM tbl_Employee WHERE EmpD= [Forms]![frm_WeeklyAttendanceSheet]![CrewOneDelimitedEmployees])
 

Attachments

  • TEST - Copy.accdb
    944 KB · Views: 40
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 09:07
Joined
Sep 21, 2011
Messages
14,301
You need some sort of flag in the employee table to indicate which list box they should appear in.
When you select one, you set that flag or clear it and requery both listboxes.
That is one way that I have done it.

You really should try searching, even here.
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:07
Joined
Sep 21, 2011
Messages
14,301
Jack,
That liink I posted also has a link you posted. :)
 

jdraw

Super Moderator
Staff member
Local time
Today, 04:07
Joined
Jan 23, 2006
Messages
15,379
Paul,
I just saw the 2 listbox thing. I followed Datapig way back when, and then worked with Crystal and John to get the series back online. Crystal got access to the videos and arranged their storage
Lot's of good videos in the series. The links are in my signature.
 

oxicottin

Learning by pecking away....
Local time
Today, 04:07
Joined
Jun 26, 2007
Messages
856
Dang fellas im going to have to try this when I get back from the holidays! Ill post back next week....

Thanks,
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:07
Joined
May 21, 2018
Messages
8,529
 

Users who are viewing this thread

Top Bottom