JaredTaylor74
Technical User
I have 2 list boxes on my form. (lstAvailableSlides & lstAssignedSlides)
lstAvailableSlides are pulled from tblHardware and lstAssignedSlides are pulled from tblToolingSets
i have an "ADD" button and a "REMOVE" button that adds any selected slide from lstAvailableSlides to lstAssignedSlides, or removes them from lstAssignedSlides... no problems there.
The problem i have is that when i "add" a slide to lstAssignedSlides i don't want it in the available list anymore... so any slide that has been assigned should not show up in the available. but if it is removed from lstAssignedSlides it should show up as available in lstAvailableSlides.
i can't remove them from the hardware table, because that data is used in many other places. i just need to "filter" them.
using an unbound form.. here is my code...
i've tried a variety of different things to have the list of available slides filter correctly... haven't been able to find anything that works yet...
Thanks in advance for any help that points me in the right direction...
Jared
lstAvailableSlides are pulled from tblHardware and lstAssignedSlides are pulled from tblToolingSets
i have an "ADD" button and a "REMOVE" button that adds any selected slide from lstAvailableSlides to lstAssignedSlides, or removes them from lstAssignedSlides... no problems there.
The problem i have is that when i "add" a slide to lstAssignedSlides i don't want it in the available list anymore... so any slide that has been assigned should not show up in the available. but if it is removed from lstAssignedSlides it should show up as available in lstAvailableSlides.
i can't remove them from the hardware table, because that data is used in many other places. i just need to "filter" them.
using an unbound form.. here is my code...
Code:
Dim strAvailableSlides, sqlAvailableSlides, sqlAssignedSlides As String
strAvailableSlides = Me.lstAssignedSlides.Value
sqlAvailableSlides = "SELECT ToolNumber FROM tblHardware WHERE (ToolType = 'SLIDE' AND Machine = 'ARBURG' AND ToolNumber <> """ & strAvailableSlides & """) ORDER BY [ToolNumber];"
sqlAssignedSlides = "SELECT MoldSetTooling FROM tblToolingSets WHERE (MoldSet = """ & cboMoldBase & """ AND ToolingType = 'SLIDE') ORDER BY [Tooling];"
Me.lstAssignedSlides.RowSource = sqlAssignedSlides
Me.lstAvailableSlides.RowSource = sqlAvailableSlides
i've tried a variety of different things to have the list of available slides filter correctly... haven't been able to find anything that works yet...
Thanks in advance for any help that points me in the right direction...
Jared