Philcjr
05-26-2011, 08:28 AM
I am using Access 2007 and just imported data from Excel files.
The data is there in Access but I can not see it. It is not a font color issue or cell shading issue. Is there some setting I am overlooking?:banghead:
I have over 1 Million records
Here is the code I used:
Option Compare Database
Option Explicit
Sub GetFilesNow()
Dim strPathFile As String, strFile As String, strPath As String, strTable As String
Dim blnHasFieldNames As Boolean
'Define if the first row in EXCEL worksheet has field names
blnHasFieldNames = True
'Define the folder that contains the EXCEL files
strPath = "C:\"
'Name of the table into which the data is going to be imported to
strTable = "MasterTable"
'Define file path and file name
strFile = Dir(strPath & "*.xls")
'Loop through files until done
Do While Len(strFile) > 0
On Error Resume Next
strPathFile = strPath & strFile
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:=strTable, _
FileName:=strPathFile, _
HasFieldNames:=blnHasFieldNames
strFile = Dir()
On Error GoTo 0
Loop
End Sub
The data is there in Access but I can not see it. It is not a font color issue or cell shading issue. Is there some setting I am overlooking?:banghead:
I have over 1 Million records
Here is the code I used:
Option Compare Database
Option Explicit
Sub GetFilesNow()
Dim strPathFile As String, strFile As String, strPath As String, strTable As String
Dim blnHasFieldNames As Boolean
'Define if the first row in EXCEL worksheet has field names
blnHasFieldNames = True
'Define the folder that contains the EXCEL files
strPath = "C:\"
'Name of the table into which the data is going to be imported to
strTable = "MasterTable"
'Define file path and file name
strFile = Dir(strPath & "*.xls")
'Loop through files until done
Do While Len(strFile) > 0
On Error Resume Next
strPathFile = strPath & strFile
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:=strTable, _
FileName:=strPathFile, _
HasFieldNames:=blnHasFieldNames
strFile = Dir()
On Error GoTo 0
Loop
End Sub