A
auujxa2 via AccessMonster.com
I have a function that works great, it makes active stores not active.
Here's the code.
For Each varItem In Me.lstActiveStores.ItemsSelected
strSQL = "UPDATE [MasterTbl] " & "SET [Indicator] = FALSE " & _
"WHERE [MasterTbl].[Vendor] = """ & Me.lstVendors.Column(0) & """" &
_
" And [MasterTbl].[Department] = """ & Me.cboDepartments & """" & _
" And [MasterTbl].[Stores] = """ & ctl.ItemData(varItem) & """"
DoCmd.RunSQL strSQL
Next varItem
I need to do the opposite. Make NonActive stores active. So I need to do an
append query, and fill the masterTbl with the 3 fields from the lst and cbo
boxes. I'm VERY new to SQL, so I don't know how to make my statement below
text delimited like the one above.
For Each varItem In Me.lstNonActiveStores.ItemsSelected
strSQL = "INSERT INTO MasterTbl(Vendor, Department, Stores)" & _
"SELECT me.lstVendors, me.cboDepartments, ctl.ItemData(varItem);"
DoCmd.RunSQL strSQL
Next varItem
Here's the code.
For Each varItem In Me.lstActiveStores.ItemsSelected
strSQL = "UPDATE [MasterTbl] " & "SET [Indicator] = FALSE " & _
"WHERE [MasterTbl].[Vendor] = """ & Me.lstVendors.Column(0) & """" &
_
" And [MasterTbl].[Department] = """ & Me.cboDepartments & """" & _
" And [MasterTbl].[Stores] = """ & ctl.ItemData(varItem) & """"
DoCmd.RunSQL strSQL
Next varItem
I need to do the opposite. Make NonActive stores active. So I need to do an
append query, and fill the masterTbl with the 3 fields from the lst and cbo
boxes. I'm VERY new to SQL, so I don't know how to make my statement below
text delimited like the one above.
For Each varItem In Me.lstNonActiveStores.ItemsSelected
strSQL = "INSERT INTO MasterTbl(Vendor, Department, Stores)" & _
"SELECT me.lstVendors, me.cboDepartments, ctl.ItemData(varItem);"
DoCmd.RunSQL strSQL
Next varItem