Search results

  1. J

    Help exporting parameter query to excel

    Ok, I have copied the mysql to a new query and modified the query so that it is working. I have also copied the updated sql statement into the mysql statement: it is breaking on Set rst = db.OpenRecordset(mySQL) CODE: Private Sub NEKMH310_Click() On Error Resume Next Dim sCriteria...
  2. J

    Help exporting parameter query to excel

    The only parameter being entered is the POST_DATE. The post_date field on the form is set to short date. I changed the RPT_DATE and TRANS_Date to the NZ function. Now I'm getting Run-time error 3075 Syntax Error (missing operator) in query expression 'AND [10q_Daily_eKMH310_Charge_data...
  3. J

    Help exporting parameter query to excel

    Now I am getting Runtime Error 3075 Syntax Error (missing operator) in query expression 'AND [10q_daily_ekmh310_charge_data (ne)].Rpt_date=## and [10q_daily_eKMH310_charge_data (ne)].Post_date=#5/25/2010# and [10q_daily_eKMH310_charge_data (ne)].Trans_date = ##. Revised Code: Private Sub...
  4. J

    Help exporting parameter query to excel

    Private Sub NEKMH310_Click() On Error Resume Next Dim sCriteria As String Dim db As Database Dim rst As Recordset Dim objApp As Excel.Application Dim objBook As Excel.Workbook Dim objSheet As Excel.Worksheet Dim strTemplatePath As String Dim sOutput As String...
  5. J

    Help exporting parameter query to excel

    Thank you! I've updated the code like you provided, now I'm getting a runtime error 3061 Too Few Parameters. Expected 2. :( The parameter is the Post_Date which comes from a form.
  6. J

    Help exporting parameter query to excel

    How are you supplying the parameter values? via a form? Yes. Here is the SQL of the query. Where would I place this in the code? PARAMETERS [Post_Date] DateTime; SELECT [10t_KMH310_Data].COID, ([Post_Date]+1) AS Rpt_Date, [10t_KMH310_Data].Dept_ID AS DEPT...
  7. J

    Help exporting parameter query to excel

    Sorry I had overlooked that. I have added the following: Set rst = db.OpenRecordset("10q_Daily_eKMH310_Charge_Data (NE)") and now I am getting a Runtime Error 3061 Too Few Parameters. Expected 2.
  8. J

    Help exporting parameter query to excel

    :confused::confused::confused::confused: I'm working on exporting a parameter query to excel. The code I am using is what I have used previously without using a parameter and the code works great! Since I have added the code for the parameter query the code is now giving a Runtime 5 error. Any...
Back
Top Bottom