Search results

  1. D

    Docmd.RunSQL - suppress Yes/No

    When I run the code below, it pops up a question to ask if I wish to delete the data. How do I set it up so that it automatically does it without this question? DoCmd.RunSQL ("DELETE * FROM tblStage2ParsedData;") Thanks, Dave
  2. D

    Recordset loop breaks

    Well, initially when I was doing everything by importing my data through a text file, going line by line, it took 4 minutes to import a smallish file. Then I streamlined it and cut it down to 20 seconds by using a mod with openevents. That was still too slow due to the file sizes I am working...
  3. D

    Recordset loop breaks

    Not sure what you mean? Do you mean create the whole query that has if statements in it?
  4. D

    Recordset loop breaks

    That solved it. Tiny typos are a right pain! Thanks for your help in any case.
  5. D

    Recordset loop breaks

    I've noticed a typo in the statement if (Len(rs2!Data > 0)). That should be if (Len(rs2!Data) > 0)!!! So, lets see what that brings!
  6. D

    Recordset loop breaks

    There is no change - still the same error. I didn't actually follow your logic on why that code mod would make any difference. To me, it seems that if you have to have 3 conditions met to do the loop, it won't make any difference putting one of them on its own line as suggested, unless I am...
  7. D

    Recordset loop breaks

    Do you mean like this? If InStr(rs2!Data, "[") > 0 Then rs3.AddNew rs3.Update ' ' Do While (Not rs2.EOF) if (Len(rs2!Data > 0)) And (InStr(rs2!Data, "[") > 0) then...
  8. D

    Recordset loop breaks

    But it has to meet all three conditions to loop and not just the "Not rs2.EOF" condition. My error comes after that Do While line of code.
  9. D

    Recordset loop breaks

    I have a code loop where I run through some data in one recordset and push the data into another recordset. Part of the code is below. I'm getting a No Current Record error when it hits the rs3.Edit code. Is that because I have done AddNew, Update but the current record still doesn't exist...
  10. D

    Declaring an array

    Ahhh that's why. I asked because I got an error when I tried to define it as a string.
  11. D

    Declaring an array

    I have the following code: Dim var var = Split(strPGNdata, vbCrLf) Since I know it is string data, should I somehow define what type of variable the var is? Thanks, Dave
  12. D

    Speed up my loop!

    I'm wondering if the whole process of trying to import my data line by line from a text file is like leaning my ladder against the wrong wall. Banana mentioned using a Query, although my sql is too weak to work out what to do. But it kind of makes sense since Access is optimized for fast...
  13. D

    Speed up my loop!

    I do need the Move lines too, not just lines starting with "[".
  14. D

    Speed up my loop!

    Good points David, although some data I import can have things like EventDate and Event, so I have to have the full monty. Here is the errant code: Public Function GetMyFile(pathToFile As String) Dim fileNum As Integer Dim myString As String Dim myTotalString As String Dim a As...
  15. D

    Speed up my loop!

    Sorry guys, I messed up. :( I have 3 loops, the loop I was modifying to speed up was in actual fact loop 3, whereas I thought I was working on loop 1. :S In other words, I have speeded up the process, but not on the slowest part. I will check the slowest part and try to apply what I have...
  16. D

    Speed up my loop!

    Typical text file would contain the following record structure: [Event "?"] [Site "London"] [Date "1794.??.??"] [Round "?"] [White "Atwood, George"] [Black "Philidor, Francois Andre Dani"] [Result "1-0"] [ECO "B21"] 1. e4 c5 2. f4 Nc6 3. Nf3 e6 4. c3 d5 5. e5 f5 6. d4 Nh6 7. h3 Qb6 8. b3 Bd7...
  17. D

    Speed up my loop!

    I am looking at alternative ways to speed up my code. I have this: Dim var var = Split(strdata, vbCrLf) Should I set the var as a string? e.g. Dim var as String
  18. D

    Speed up my loop!

    Ok, result of a test. For this loop I knocked the time down from 56s to 53s, so not a lot of difference. Shame. What about instead of using var(i), set myString=var(i) and instead use myString? Is it faster than looking up var(i) each time?
  19. D

    Speed up my loop!

    One line of data is one field only. A record is spread over several lines.
  20. D

    Speed up my loop!

    I get a compile error "Else without if", on this line: ElseIf InStr(var(i), "[Site ") > 0 Then Do I need to put a carriage return after each Then statement? Edit: I put a carriage return after teh first Then statement and it worked.
Back
Top Bottom