Results 1 to 3 of 3

Thread: Code a list field with File name, in VB, using a SQL statement

  1. #1
    Junior Member
    Join Date
    Jul 12
    Location
    Here
    Posts
    18

    Code a list field with File name, in VB, using a SQL statement

    Hello all!

    As i am importing several data files into one database (in Access) I am trying to code a list field with the appropriate file names using a SQL statement, this is what i have so far:
    Code:
    If Right(objF1.Name, 3) = "CSV" Then
    FileName = objF1.Name
    DoCmd.TransferText acImportDelim, "ImportSpec", "ELDO_COMBINED", orgLocation & objF1.Name, False
    
    DoCmd.SetWarnings False
    DoCmd.RunSQL "UPDATE ELDO_COMBINED '" & FileName & "' WHERE ELDO_COMBINED.LIST IS NULL ;"
    DoCmd.SetWarnings True
    
    MsgBox objF1.Name
    End If
    Next
    The red line is the SQL statement i came up with that is not working, any help would be awesome!

  2. #2
    PowerPoster kevininstructor's Avatar
    Join Date
    Jun 08
    Location
    Oregon
    Posts
    5,001

    Re: Code a list field with File name, in VB, using a SQL statement

    Hello, this would be the wrong forum for MS-Access VBA questions.
    This would be best http://www.vbforums.com/forumdisplay...ce-Development

  3. #3
    Junior Member
    Join Date
    Jul 12
    Location
    Here
    Posts
    18

    Re: Code a list field with File name, in VB, using a SQL statement

    thanks kevin!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •