Search results

  1. MushroomKing

    Export to Excel, if row is not null, export to next row

    Hi Arnel, thanks for replying again. Some lines are in comment? When i remove those comma's and run it i get Not defined strSQL = I'm about to give up. Been screwing around for over a week. It's getting a little rediculous.
  2. MushroomKing

    Export to Excel, if row is not null, export to next row

    I'm messing this one up BIG TIME. Also i need 2 variables (in between dates) and dont know how to spell it out. Sub XferData2XL() DoCmd.SetWarnings False Dim sFile As String Dim xl As Excel.Application Dim rst Dim lngLast As Long strSQL = "SELECT KPICOLLECTIVE.* From KPICOLLECTIVE WHERE...
  3. MushroomKing

    Export to Excel, if row is not null, export to next row

    Damn! haha, just noticed the second page on the forum :D Thank you so much guys, let me try all this.
  4. MushroomKing

    Export to Excel, if row is not null, export to next row

    Right but it is open. The button that runs the code is on that same form. It just doesn't seem to do anything with it. SELECT * FROM KPICOLLECTIVE That part looks like its made for a table, not for a query that has to run itself first. I run the query in VBA first en then the rest of the...
  5. MushroomKing

    Export to Excel, if row is not null, export to next row

    Thank god for you people! Cant say how much i appriciate the help. It works, but if i put some parameter stuff in there it complains again. For example, in 1 of the queries, i have the following field: Date: [Forms]![stats_form]![startdate] This works fine when i use it elsewhere, just not...
  6. MushroomKing

    Export to Excel, if row is not null, export to next row

    Thanks for the reply man! Well, both are correct. .ActiveCell.Offset(1, 0).Select and the correct refference. :confused:
  7. MushroomKing

    Export to Excel, if row is not null, export to next row

    Thanks for that addition! Now, with or without it, i get another error :banghead::banghead: Application defined or object defined error ActiveCell.Offset <<<debugger Life's hard...coding is harder
  8. MushroomKing

    Export to Excel, if row is not null, export to next row

    Correct guys! It is asking for 2 parameters and its a query. It needs a starting and an ending date (between date), Which it takes directly from the form fields. So i thought, just run the query and then call the export and it will be solved. But no... DoCmd.OpenQuery "KPICOLLECTIVE" Call...
  9. MushroomKing

    Export to Excel, if row is not null, export to next row

    Whooo! Thanks man! Looks promising. Just tried it. Gives me "too few parameters, expected 2" on line: Set rst = CurrentDb.OpenRecordset("select * from KPICOLLECTIVE") KPICOLLECTIVE is a query that has only 1 row with values. Does that matter in any way? :confused: Anyway, big step forward...
  10. MushroomKing

    Export to Excel, if row is not null, export to next row

    Hi everyone, I'm exporting some query data to an Excel sheet. However, i don't want to overwrite the data (on the same row) everytime i run the code. DoCmd.TransferSpreadsheet acExport, 8, "query", "C;\...", True, "cellrange" I would rather keep all the data. So when i run the code, i want...
  11. MushroomKing

    Access export queries to excel, with date equal to date in row

    Thanks gasman! It works now. Because of this solution, one little problem has risen. DoCmd.TransferSpreadsheet acExport, 8, "query", "C;\...", True, "cellrange" Is it maybe possible, every time i run this code, to put it underneath the last row? Instead of overwriting it every time...
  12. MushroomKing

    Access export queries to excel, with date equal to date in row

    Not the same at all no :). DoCmd.TransferSpreadsheet acExport, 8, "Qry1", "C:\accesstool...", True, "B1" I can not just add another query to that??
  13. MushroomKing

    Access export queries to excel, with date equal to date in row

    Alright! MAYBE that could be an idea ofcourse. Let me try this :). How do i export multiple queries in the below code? DoCmd.TransferSpreadsheet acExport, 8, "Qry1", "C:\accesstool...", True, "B1" I tried some alternatives but my syntaxes are not right. Thanks for your help!
  14. MushroomKing

    Access export queries to excel, with date equal to date in row

    Thanks Minty. I understand this would be a solution. In this case it's not. I'm exporting to a really complicated file which is a template for the company to generate reports. I just want to fill in the rows where the date is the same as on my access form.
  15. MushroomKing

    Access export queries to excel, with date equal to date in row

    Thanks for the swift reply :) The query results in access all have 1 single value (sum totals). Maybe i can pseudo write something like: Do.Export "Query1" to "excelsheet.xls" into column "B" where row (date) = equal to "FormDateField" in Access
  16. MushroomKing

    Access export queries to excel, with date equal to date in row

    Hi everyone! I've been trying to export queries to excel in vba. Which works alright but needs some work still. I am completely stuck on where to start when it comes to exporting the data in dynamic (date) cells. Let me explain: - I have multiple queries in Access. (Qry1, Qry2, Qry3) - I have...
  17. MushroomKing

    if there are no records, do nothing. Error 2427

    Thanks MajP!!!!! That worked like a charm :) To answer the question, im refeshing this form to display results on a monitor. The final code i used is: Private Sub Form_Timer() DoCmd.Requery Me.Refresh Text19.SetFocus If Not (Me.Recordset.BOF And Me.Recordset.EOF) Then If Me.perpack= 1 Then...
  18. MushroomKing

    Query data not correct, calculation for some records incorrect

    Hi dudes :) Wauw. I'm not sure :S im such a rookie trying to understand it all. I just thought its weird because all the other values are spot on. What im trying to get is just the difference between the time, and in another query, i sum that difference column and have a total time (present)...
  19. MushroomKing

    if there are no records, do nothing. Error 2427

    Hello :) Can anyone explain to me how this works please? I can't avoid this error and i think its pretty basic. I'm only a rookie and cant find it on google. I have a timer event (please dont ask why) When the field value is "something" it needs to play a sound. But if there are no records...
  20. MushroomKing

    Query data not correct, calculation for some records incorrect

    Hello everyone. Im new here :) I wonder if anyone could help me out with some issues i have on my query. My query has 2 time fields. I calculate the difference between the time in minutes. The data seems correct, BUT not for EVERY record. I cannot place where it goes wrong or how it gets that...
Back
Top Bottom