Search results

  1. H

    SQL query over mutiple tables

    Sorry for my late answer. Only wanted to thank you all again for your help and @vbaInet: I made the connections like you said. Works fine so far :)
  2. H

    SQL query over mutiple tables

    @namliam: Thank you for your code, this is exactly what I was looking for =)) I'm still new into VBA and Access and I didn't conceive of if strdetec <> "" then and then attaching the right "tail" to the SQL string. Didn't know it could work like this. Learning never stops :) @vbaInet: I'm...
  3. H

    Run-time error 1004 while Export to Excel

    @vbaInet: I think I didn't really express myself correctly :D The DoCmd.TransferSpreadsheet acExport function only accesses the query with the name strQuery, but it doesn't care how the query was created. So when I leave your code inside a normal private sub and have another sub that is...
  4. H

    SQL query over mutiple tables

    Hello community, I have a problem / question regarding a SQL query and I hope you can help me. My initial situation: I have 3 tables that I INNER JOIN together with a number. The number is the same in each table. By doing this I get a big table with 11 columns. The tables I use look like this...
  5. H

    Run-time error 1004 while Export to Excel

    @vbaInet: If I understood you correctly then you mean that I have to manually create strQuery as a new query and alter the SQL code inside it, right? Honestly, this isn't a bad idea at all :D I have SQL code that changes every time but I can save the code in that specific strQuery query and...
  6. H

    Run-time error 1004 while Export to Excel

    Thanks a lot for all your answers! So I edited my code it now it almost works how I want: Private Sub Befehl62_Click() On Error GoTo ErrorHandling Dim xlApp As Object Dim strQuery As String Dim db As DAO.Database Dim qdf As DAO.QueryDef Const xlsxPath =...
  7. H

    Run-time error 1004 while Export to Excel

    @vbaInet: Thank you for your code! Unfortunately it gives me a run time error 3265: couldn't find element in this list. And it's pointing at the line cdb.QueryDefs(strQuery).sql = "SELECT * FROM tblDetector;" Any ideas what's wrong with it?
  8. H

    Run-time error 1004 while Export to Excel

    @gemma-the-husky: Thank you for your answer! :) My code is complete, I didn't delete anything before posting (only edited the path to the Excel file). Can you advise me how to add proper error handling to my code? I would use the Debug.Print method. But which variable should I print out? I...
  9. H

    Run-time error 1004 while Export to Excel

    Hello, I'm using Access 2010 and I want to export a query to Excel by clicking a button. Every time I click on it Excel opens but doesn't open my worksheet, it's just gray like you just open the program without a table. After exiting it Access tells me I got a run time error 1004: the...
  10. H

    Copy values into following fields

    @CJ_London: Maybe it gets clearer when you see the end result. With copying values I mean copying the "content" of the field in column country in record 1 (here 21646521) into record 2 column country. And do this with all the other clomuns, but stop there where a new number appears (here...
  11. H

    Copy values into following fields

    Hello, in order to get a better data base I want to fill some empty fields in my data record with values from another data record. In my table I have 5 columns, I created my table here very quickly because I'm not allowed to post pictures: ID | Sales Receipt | Description |...
  12. H

    Runtime Error 3061 in Acc2010

    Thanks a lot for you two reply's! The solution provided by CJ_London works perfectly, this is that I was looking for. I was also reading something in the meantime that assigning an SQL query to a text-field isn't a good idea respectively a text-field isn't suitable for this. Better to use is...
  13. H

    Runtime Error 3061 in Acc2010

    Hello, I've a problem in Access. Every time I perform a SQL query to write the result of the query into a text-field I get a run time error 3061 : Too few parameters. Expected 1. This is my code: Private Sub Text0_AfterUpdate() Dim str As String, strSQL As String str =...
Back
Top Bottom