Search results

  1. H

    help out! docmd.runsql "..." get error 2051

    Finally resolved. It is just a trust center setting of Access 2007. The VBA code in Excel will show this kind of errors,unless set the VBA program as an trusted resource for the Access file you refer to. Thanks lot boblarson man!!! I am new to access 2007. I thought just enable Macro is enough...
  2. H

    help out! docmd.runsql "..." get error 2051

    bob,you are great! It works. But I define an access.application because we have lot qureies being setup in an Access file. some report analysis don't use VBA. My VBA's function is focus on automation the process and format output. the Report analyst don't need to know VBA, and they can just...
  3. H

    help out! docmd.runsql "..." get error 2051

    Thanks boblarson ! current my reference is 1. Visual Basic for Application C:\Program Files\Common Files\Micorsoft Shared\VBA\VBE6.DLL 2. OLE Automation C:\WINDOWS\SYSTEM32\STDOLE2.TLB 3. Microsoft Access 12.0 Object Library C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE12\MSACC.OLB 4. Micorsoft...
  4. H

    help out! docmd.runsql "..." get error 2051

    Exactly! it works in excel 2002 and access 2003. now we just update access to 2007. This happened. I test in excel 2007 and access 2007. define a string for the SQL statement strSQL = "delete ...." app.docmd.runSQL strSQL it also work. but our office be approved only updating access to 2007...
  5. H

    help out! docmd.runsql "..." get error 2051

    Thanks for the fast response. Please notice I am using Excel 2002 and access 2007. code attached. Sub run_sub_report() Dim App As New Access.Application Dim path As String On Error GoTo Error_Handler path = ActiveWorkbook.path With App .OpenCurrentDatabase (path & "\CRUNCH.MDB")...
  6. H

    help out! docmd.runsql "..." get error 2051

    Using VBA in Excel 2002 , Access 2003 created a report tool .runs well. until last week we update access2003 to 2007.(excel still 2002). get error for grammar :" docmd.RunSQL "update .... " " Error message show "The RunSQL action was canceled." Reference: 1. Visual Basic for Application...
Back
Top Bottom