Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multi Select List delete records from table

Posted on 2008-10-01
2
Medium Priority
?
514 Views
Last Modified: 2010-04-21
Hello,

I have a multi select list box that I'm appending records to 1 table but I want to delete records from another table.  I'm not getting any errors in the code below.  It Appends records to my table tblOOSInventory but it's not deleting the records in my tblItemsIssued.  I'm not sure if there is an issue in my delete statement or not.  

Any help would greatly be appreciated.

Thanks,
Lisa


Dim strItems As String
    Dim intItem, sql, SQL2

    With Me.List2
    For intItem = 0 To .ListCount - 1
        If .Selected(intItem) Then
            strItems = strItems & .Column(0, intItem) & "," & _
                                  .Column(1, intItem) & "," & _
                                Chr(39) & .Column(2, intItem) & Chr(39) & "," & _
                                Chr(39) & .Column(3, intItem) & Chr(39) & "," & _
                                Chr(39) & .Column(4, intItem) & Chr(39) & "," & _
                                Chr(39) & .Column(5, intItem) & Chr(39)

        sql = "Insert into tblOOSInventory(InvIssID, EmpID, IssBC, InvType, Size, ILOC) values (" & strItems & ")"
        Currentdb.Execute sql
        strItems = ""
        SQL2 = "Delete * FROM tblItemsIssued Where InvIssID= "
        SQL2 = SQL2 & List2.Selected(intItem) & ";"
               Currentdb.Execute SQL2
               End If
    Next
    End With
0
Comment
Question by:AnneYourPointIs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 22614830

        SQL2 = "Delete * FROM tblItemsIssued Where InvIssID= " & .itemdata(intItem)
     
               Currentdb.Execute SQL2
0
 

Author Closing Comment

by:AnneYourPointIs
ID: 31501989
Thank you
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question