|
-
Aug 9th, 2012, 05:40 PM
#1
Thread Starter
Junior Member
Help! Coding a List filed with file names using a SQL statement in VB
Hello all!
i am importing several data files into one database in Access. I am trying to code a list field with the file names the data was imported from, 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!
-
Aug 10th, 2012, 03:52 AM
#2
Re: Help! Coding a List filed with file names using a SQL statement in VB
i am not sure you can match to null like that, not that i have tried
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 10th, 2012, 11:35 AM
#3
Thread Starter
Junior Member
Re: Help! Coding a List filed with file names using a SQL statement in VB
i want the records to be coded with the file name in which they were imported from
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|