Search results

  1. D

    Speed up my loop!

    One other aspect is that do you think I should be using Left instead of Instr? ElseIf InStr(var(i), "[Date ") > 0 Then rs!DateField = var(i) The field will always start "[Date " so I wondered if Instr is slower since it has to search the whole line?
  2. D

    Speed up my loop!

    Ooops, I missed that you already suggested. My apologies and thank you!
  3. D

    Speed up my loop!

    Actually David that is a very clever point. I just didn't see that. Any pointers in how I might do that? I can't see a way. Some form of Select Case?
  4. D

    Speed up my loop!

    I have some code that parses up to a million lines of data and its pretty slow. So, using the genius minds on Access Word forums, could some bright spark tell me if my code is optimum for speed or could I change it to be faster? Below is the main batch of code in my loop. Last time I ran it, it...
  5. D

    Counting lines in text file

    Haha, too right there! Maybe an afternoon nap too.
  6. D

    Populating Listbox control with Query Object

    Nice code find - sweet as a nut! All working and a big thanks. :)
  7. D

    Populating Listbox control with Query Object

    I mean to populate the listbox with my list of Query objects. e.g. qryExport1 qryExport2 Do I have to do a loop and read the object names somehow?
  8. D

    Populating Listbox control with Query Object

    I have a listbox control that I want to populate with my list of Queries when the Form loads. How can I do that? Thanks, Dave
  9. D

    Counting lines in text file

    Ok, so its click Import and go make a cup of coffee time! :)
  10. D

    Counting lines in text file

    Liked the idea of a percentage and adopted that on another import process I have - thanks! My text files can have over 100,000 lines to process, so import is fairly slow. Is there a faster way to import?
  11. D

    Counting lines in text file

    I have the following code to import a text file, with a counter to show the progress. Public Function GetMyFile(pathToFile As String) Dim fileNum As Integer Dim myString As String Dim myTotalString As String fileNum = FreeFile Open pathToFile For Input As #fileNum x = 0...
  12. D

    ByRef Argument type mismatch

    Found the answer, funnily enough on this forum! When using this code snippet, you need to change myStrFilter to StrFilter. Also, make sure you add the following likes to your procedure: Dim strFilter As String Dim strSaveFileName As String
  13. D

    ByRef Argument type mismatch

    I have a code snippet taken from here: http://www.mvps.org/access/api/api0001.htm 'Ask for SaveFileName strFilter = ahtAddFilterItem(myStrFilter, "Excel Files (*.xls)", "*.xls") strSaveFileName = ahtCommonFileOpenSave( _ OpenFile:=False, _...
  14. D

    Releasing processor usage from loop

    Ahh that sounds familiar! Will check out DoEvents thanks.
  15. D

    Releasing processor usage from loop

    How do you let your PC get a little bit of CPU time back again, when in a long vba loop? Knew this before but forgot! Dave
  16. D

    Simple text import

    Perhaps I could just add vbcrlf to the end of each line as it is input?
  17. D

    Simple text import

    Its not a linear parsing of each text line though. For example, it does a different looping if it finds a line without a certain criteria met. Then, it goes through several more lines inside that loop until another criteria is met. Then it goes back to the normal loop. Consequently, I can't do...
  18. D

    Simple text import

    I think that is going to be complicated because I have already written all the code for parsing. It would involve too many changes. I just need a separate routine to import a text file into a string.
  19. D

    Simple text import

    I get an error with that code, "Do without Loop" Where should the missing Loop go?
  20. D

    Simple text import

    Private Sub cmdParse_Click() Dim db As DAO.Database Dim rs As DAO.Recordset Set db = CurrentDb() Set rs = db.OpenRecordset("Table1") Dim strPGNtoCSV As String Dim strPGNdata As String 'strPGNdata = PGNdata strPGNdata = GetMyFile("C:\Documents and...
Back
Top Bottom