Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    1,473
    You're welcome!
    Stay safe!


    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  2. #17
    jmichaels is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2020
    Posts
    12
    The code that @Gicu gave me is working great. However, I think that before I uploaded the sample data, I may have inadvertently reformatted it slightly. The sample data works fine, but all of the other csv files have quotes around the text fields when imported into my Access table. Is there a way to address that in the code?

  3. #18
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    1,473
    Try this:

    'MyArray = Split(strLine, ",") 'Comment out this line and replace it with the following
    MyArray = Replace(Split(strLine, ","),Chr34,"")

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,523
    Except need parens for Chr function:

    Chr(34)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    1,473
    Thanks June, still in bed.....
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #21
    jmichaels is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2020
    Posts
    12
    Thank you both for the quick response. I made the change, but now it's giving me the following error message: Run-time error "13": Type mismatch

    The new line is highlighted:
    MyArray = Replace(Split(strLine, ","), Chr(34), "")

    Any ideas?

  7. #22
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,523
    Try replacing then splitting.

    MyArray = Split(Replace(strLine, Chr(34), "") ",")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #23
    jmichaels is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2020
    Posts
    12
    That did the trick! You are both saving me SO much time each month. I really appreciate it. I will probably have questions on a few other things I'm trying to automate.

    Stay safe and healthy! Thanks again!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Link an email to line item in Access
    By BaldEagleOne in forum Access
    Replies: 5
    Last Post: 02-04-2020, 06:30 PM
  2. Line item dependencies
    By mcucino in forum Programming
    Replies: 1
    Last Post: 10-18-2018, 11:15 AM
  3. Replies: 6
    Last Post: 09-29-2017, 04:58 PM
  4. Replies: 2
    Last Post: 05-07-2014, 11:16 AM
  5. Line item query
    By michaeltorpedo in forum Queries
    Replies: 9
    Last Post: 05-02-2012, 01:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums