Results 1 to 3 of 3
  1. #1
    lukefinnemore is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2013
    Posts
    1

    Error 3141 Debugging - Help Needed


    First post on the forum...I've been continually getting a select statement error despite the code posted below doing what I intended for it to do. Given my rudimentary knowledge of SQL this is one is over my head. Also, if this is not the correct code (hopefully posted below) where can I find the source. Please forgive my lack of knowledge.

    Code:
    Private Sub SiteDone_Click()
    
    
    Dim rstActiv As Recordset
    Dim strsql As String
    Dim varA As Variant
        
        
        ' first delete existing Site Characteristics
        strsql = "Delete * from tblSite"
        CurrentDb.Execute strsql
       
        Set rstActiv = CurrentDb.OpenRecordset("tblSite")
           
        'Add the selected Activities
               
            rstActiv.AddNew
            rstActiv!RecPCt = SiteRecPCt
            rstActiv!ProjDollars = SiteInvest
            rstActiv!ProjAcq = ProjectType
            rstActiv.Update
            
        rstActiv.Close
        Set rstActiv = Nothing
        
       DoCmd.RunMacro "macReports"
        
    End Sub

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you click "Debug", which line of codes does it highlight (and therefore, think is the problem)?

    See if it works any better to replace your first block of code with this:
    Code:
        ' first delete existing Site Characteristics
        strsql = "Delete [tblSite].* from tblSite"
        DoCmd.RunSQL strsql

  3. #3
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    1) Which line gives you ther error?
    2) If there is a query called "tblSite", then please post the SQL for that query here. If not, then please post the table structure. You may have fields named as reserved words, like "Date".
    3) The macro "macReports" may contain embedded queries. each one has to be checked for syntax issues.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 07-24-2013, 12:22 PM
  2. Run-Time error 3141
    By CementCarver in forum Programming
    Replies: 5
    Last Post: 06-19-2013, 08:50 AM
  3. Debugging a Select Case Statements (Still)
    By dccjr in forum Programming
    Replies: 13
    Last Post: 02-28-2013, 09:47 PM
  4. Debugging
    By eacollie in forum Programming
    Replies: 2
    Last Post: 06-04-2011, 05:29 AM
  5. Debugging help
    By Buakaw in forum Access
    Replies: 3
    Last Post: 02-16-2011, 09:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums