Search results

  1. F

    Add query data to existing export function

    Hello I'm trying to add some data to an VBA-export function I created a while ago. Basically I need to add the data from the table Stik_Samling to the bottom of my first export function with OpenRecordset VBK_Knude. However I've run into a few issues, the number of columns in Stik_Samling can...
  2. F

    Solved Use query with subquery, to run an update query?

    I fixed it, but doing a work around with a temporary table and updating using that.
  3. F

    Solved Use query with subquery, to run an update query?

    Appreciate the response, I tried a different approach but still get the same error. Basically I have two very standard select queries, that I put together with a simple Join One-To-One. After that I have a new query (which was previously with a subquery, now with the VBA below). The only...
  4. F

    Solved Use query with subquery, to run an update query?

    I'm trying to update a tables in access database column based on a query that I've shown below. I keep getting an error saying "Operation must use an updatable query." I have one standard select query before the one shown below, which I believe is the culprit. The subquery that counts and gives...
  5. F

    Solved Add result from one function to another export function

    Absolutely brilliant, it works like a charm. Thank you very much for your help and patience!
  6. F

    Solved Add result from one function to another export function

    I did that because it gave me a Compile Error : Next without For with it in., but again I'm totally newbie at this still, so a lot of trying to understand, and then trial and error 😅
  7. F

    Solved Add result from one function to another export function

    Almost there I think, I changed a little bit in your code to the one below: Set rst = dbs.OpenRecordset("VBK_Ledninger_TXT", dbOpenSnapshot, dbReadOnly) Print #fnum, "" With rst If Not (.BOF And .EOF) Then .MoveFirst OK = True End If...
  8. F

    Solved Add result from one function to another export function

    You absolute beauty! This works perfectly well. Now the last thing I have to do, is basically move the location of the XY output, so its position is as shown in the output. So basically it needs to come after the first value which is always $Ledning. I'm thinking that I could perhaps do...
  9. F

    Solved Add result from one function to another export function

    That comes from VBK_Knude table, which is different from the other. Though the exported name is the same. I figured it was difficult to show with the XY being multiple for the same line, but you might have a point. VBK_Ledning_TXT Query, note that there is no XY as this comes from JoinTables...
  10. F

    Solved Add result from one function to another export function

    All the fields, the end .vbk file should look a lot like this(just to give an example). All the XY's with a $Ledning at the top (VBK_Ledning_TXT), should come from the JoinTables function. $KNUDE '07' XY 1870.78 108.95 0.0 0.80 0.80 Z_F 40.08 DYBDE 0.70 OB 0.70 POSTNR '14.67.04' HTYPE...
  11. F

    Solved Add result from one function to another export function

    Sorry that was a left over part, from when I exported the JoinTables to a separate file, just too se if the output was as expected. I've just deleted it in my first post. The only bit that needs exporting is the .vbk file which contains: VBK_Knude, VBK_Ledninger_TXT (including the XY from...
  12. F

    Solved Add result from one function to another export function

    Appreciate the help! Well firstly I am in no way an expert, so I'm kinda learning by doing. So any help is much appreciated, the part in JoinTables I wrote I got to function with the expected output and didn't think about optimizing it. Yours is probably a lot better. Previously I had an XY...
  13. F

    Solved Add result from one function to another export function

    I have a VBA-function that currently joins two queries and finds the XY in sequence between two and exports it in a seperate file (export not shown). I also have a different function that exports a table in a very specific format needed for it to be importable in another program. Instead of...
  14. F

    Iif query returns duplicate rows with null data

    Much appreciate your help, I will have a look into what you suggest! And the database in question is set up to work with a specific program, but the data structure is terrible. Also I'm a programmers worst nightmare, someone with basic understanding but no best practice and methods :p Side-note...
  15. F

    Iif query returns duplicate rows with null data

    Sorry I've updated with full SQL.
  16. F

    Iif query returns duplicate rows with null data

    Hello I'm trying for each ID to get the PIl_TXT, DIM_TXT, FRA_TXT and TIL_TXT. I'm trying to pull the values using an Iif function in the query. However I know I'm doing something wrong, as I'm getting 8-10 rows (with Distinct and without Distinct), where the expected output should be 2 rows...
  17. F

    Solved Export Query to txt where each row of data comes in groups?

    That is just lovely! Thank you very much for the help!
  18. F

    Solved Export Query to txt where each row of data comes in groups?

    Hello I have a pretty basic data setup, where the end query looks like the data in the table: $NODE XY Z_F Depth OB POST HTYPE UTYPE LTYPE ENTREPRISE STATUS DIMENSION STATION PERPEND CATCHMENT Q A_KOEF ANM Owner TEXTXY DK_TXT '01' 6200000;454545 40.10 1.20 0.70 '1.1.2' 'KO' 'Well' 'KO'...
  19. F

    Count number and multiply with field value

    Hello I'm trying to do a Total query, that is calculating the cost of building certain systems. Right now I'm just trying to count the number of Nodes and multiply that with field UnitPrice, to find out how must the cost of nodes is based on their size (the sum of all the money spent on 1 meter...
  20. F

    Rank query returning same rank

    Thank you for all the replies. Was hoping it was possible to do this with a perhaps a subquery or some Iifs, but seems VBA is the way to go. If anyone has a sample code that I could use, that would be much appreciated :) @Plog. I do have for each item the "Vendorname"-"Price" which I think...
Back
Top Bottom