-
1
- #1
Ok I need to import a exported spreadsheet into a table in Access. I am able to import the data from the text file which is delimited and sepereated with commas, only if the field headings are at the top. My deliemma is that when the file is exported, I can't get it to export the proper headings.. What I need to do is make access either accept the file without the headings (which currently gives an error about heading "f1" not existing(which isn't in the file anywhere)) or I need a piece of code that will add a line at the top of that text file with the required headings. Here is my code so far which only works if the proper headings are there:<br><br>Private Sub Button10_Click()<br> Dim db As Database<br> Dim file As String<br> Set db = CurrentDb<br> <br> <br> If IsNull(Me!FILENAME) Then<br> RESPONSE = MsgBox("Require a Filename", 48, "Problem"
<br> Exit Sub<br> Else<br> DoCmd.TransferText acImportDelim, , "JOB PICK QTY", file, True<br> End If<br> db.close<br>End Sub<br><br>The user types in the file name in a form by the way..<br><br>thanks in advance!