Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Null Values

Status
Not open for further replies.

khosseini

Programmer
Sep 14, 2006
18
US
I am working on a large import app, from excel 2003 to access 2003, and I have gotten it to import several workbooks and worksheets within the workbooks, it is however also importing the fields with nothing in them. I know that is how it is set up and not sure how to say if the fields are empty or include one 0 do not import them. Here is my snippet.

If Dir("C:\Group1.xls") <> " " Then
DoCmd.TransferSpreadsheet acImport, , "Students", "C:\GROUP1", True, "Students1!A1:I23"
DoCmd.TransferSpreadsheet acImport, , "FA03", "C:\GROUP1", True, "FA03!A1:D23"
DoCmd.TransferSpreadsheet acImport, , "SP04", "C:\GROUP1", True, "SP04!A1:D23"
DoCmd.TransferSpreadsheet acImport, , "FA04", "C:\GROUP1", True, "FA04!A1:D23"
DoCmd.TransferSpreadsheet acImport, , "SP05", "C:\GROUP1", True, "SP05!A1:D23"
End If

Thanks!
Kendra
 
In contemplating this I came up with this to start solving my problem...also may need this statement by worksheet. A nudge in the right direction would be appreciated. Thanks!

If Dir("C:\Group1.xls") <> " " Then
If IsNull("C:\Group1.xls") Then
'need to add a do nothing statement, or not sure how to do this by worksheet...
Else
DoCmd.TransferSpreadsheet acImport, , "Students", "C:\GROUP1", True, "Students1!A:I"
'...rest of code for transfer for this group
End If
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top