G
Guest
I have a form that will filter a list of items into a listbox called ItemsLbx
based on the selection of several comb boxes. I would like to create a
button that will print out whatever the currnet filter is on that list box
after I have done my comb box slections. here is my code:
Private Sub ProjectLbx_AfterUpdate()
On Error Resume Next
ItemsLbx.RowSource = "SELECT
[ItemID],[EnteredBy],[Level],[Room],[AOR],[System],[Sub],[Own_Arch],[ByActStat],[WTC],[PL],[ProjectNum],[Date]" & _
"FROM ItemMasterTbl " & _
"WHERE ItemMasterTbl.ProjectNum = '" &
ProjectLbx.Value & "'"
Call ProjectLbx.Requery
End Sub
Private Sub SrtLevelCbx_AfterUpdate()
ItemsLbx.RowSource = "SELECT
[ItemID],[EnteredBy],[Level],[Room],[AOR],[System],[Sub],[Own_Arch],[ByActStat],[WTC],[PL],[ProjectNum],[Date]" & _
"FROM ItemMasterTbl " & _
"WHERE ItemMasterTbl.Level = '" & SrtLevelCbx.Value
& "'" & _
"AND ItemMasterTbl.ProjectNum ='" & ProjectLbx.Value
& " '"
Call SrtLevelCbx.Requery
End Sub
Private Sub SrtRoomCbx_AfterUpdate()
ItemsLbx.RowSource = "SELECT
[ItemID],[EnteredBy],[Level],[Room],[AOR],[System],[Sub],[Own_Arch],[ByActStat],[WTC],[PL],[ProjectNum],[Date]" & _
"FROM ItemMasterTbl " & _
"WHERE ItemMasterTbl.Room = '" & SrtRoomCbx.Value &
"'" & _
"AND ItemMasterTbl.Level ='" & SrtLevelCbx.Value & "
'" & _
"AND ItemMasterTbl.ProjectNum ='" & ProjectLbx.Value
& " '"
Call SrtRoomCbx.Requery
End Sub
Any help you can give will be greatly appreciated!
based on the selection of several comb boxes. I would like to create a
button that will print out whatever the currnet filter is on that list box
after I have done my comb box slections. here is my code:
Private Sub ProjectLbx_AfterUpdate()
On Error Resume Next
ItemsLbx.RowSource = "SELECT
[ItemID],[EnteredBy],[Level],[Room],[AOR],[System],[Sub],[Own_Arch],[ByActStat],[WTC],[PL],[ProjectNum],[Date]" & _
"FROM ItemMasterTbl " & _
"WHERE ItemMasterTbl.ProjectNum = '" &
ProjectLbx.Value & "'"
Call ProjectLbx.Requery
End Sub
Private Sub SrtLevelCbx_AfterUpdate()
ItemsLbx.RowSource = "SELECT
[ItemID],[EnteredBy],[Level],[Room],[AOR],[System],[Sub],[Own_Arch],[ByActStat],[WTC],[PL],[ProjectNum],[Date]" & _
"FROM ItemMasterTbl " & _
"WHERE ItemMasterTbl.Level = '" & SrtLevelCbx.Value
& "'" & _
"AND ItemMasterTbl.ProjectNum ='" & ProjectLbx.Value
& " '"
Call SrtLevelCbx.Requery
End Sub
Private Sub SrtRoomCbx_AfterUpdate()
ItemsLbx.RowSource = "SELECT
[ItemID],[EnteredBy],[Level],[Room],[AOR],[System],[Sub],[Own_Arch],[ByActStat],[WTC],[PL],[ProjectNum],[Date]" & _
"FROM ItemMasterTbl " & _
"WHERE ItemMasterTbl.Room = '" & SrtRoomCbx.Value &
"'" & _
"AND ItemMasterTbl.Level ='" & SrtLevelCbx.Value & "
'" & _
"AND ItemMasterTbl.ProjectNum ='" & ProjectLbx.Value
& " '"
Call SrtRoomCbx.Requery
End Sub
Any help you can give will be greatly appreciated!