Solved

How would you define the internal field DATE TYPES for table tblTest based on the following XLS file titeld "Test.xls"

Posted on 2011-02-24
9
311 Views
Last Modified: 2012-05-11
I am developing an Access application using Access 2003 with an MDB type file.
How would you define the internal field DATE TYPES for table tblTest based on the following
XLS file titled "Test.xls" which serves as the input source?

I would use the following statement to import the Excel file into the Access table:

filenm = "U:\TEST.XLS"

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblTest", filenm, True

For example:

When I defined all the table fields as DATA TYPE "Text", my results were as follows:

XLS file                       Access table tblTest imported to:

CORP/CMPY                CORP/CMPY
---------------               ----------------------------
0655                           655 (missing lead zero)

BALANCE SHEET       BALANCE SHEET    
G/L #                          G/L #
-------------------          --------------------------------
100-003400                no value

M&D/ISG G/L #           M&D/ISG G/L #
--------------------        -----------------------
N/A                             no value

Test.xls
0
Comment
Question by:zimmer9
  • 5
  • 2
  • 2
9 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 34975087
CORP/CMPY: Integer. Set Format to "0000"
BALANCE SHEET G/L #: String
M&D/ISG G/L #: String. Set "Allow Null values" to True

/gustav
0
 

Author Comment

by:zimmer9
ID: 34975249
How do you assign "STRING" as the DATA TYPE for a field within an internal access table?

I see DATA TYPES of:the following from within an internal Access table:

Text
Memo
Number
Date/Time
Currency
Auto Number
Yes/No
OLE Object
Hyperlink
Lookup Wizard



0
 
LVL 3

Expert Comment

by:trbaze
ID: 34975747
String is any of the above.  Typically you would use the Text or Memo.
0
 

Author Comment

by:zimmer9
ID: 34975836
What DATA TYPE do I use for the field CORP/CMPY to fix the following error in which NO VALUE is being populated into field CORP/CMPY when IMPORTING into the Access table from the XLS file :

As per XLS file:                As per table tblTest

CORP/CMPY                     CORP/CMPY  
---------------                     -----------------
5711/ 655                         no value  
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:zimmer9
ID: 34975855
In Excel, field CORP/CMPY is defined as Number   Category: Custom  
Type  ###
0
 
LVL 3

Expert Comment

by:trbaze
ID: 34975871
In access you would need to set the datatype for CORP/CMPY to TEXT.
0
 

Author Comment

by:zimmer9
ID: 34975897
When I set the CORP/CMPY field to TEXT in the Access table, I get no value for this field in the Access table for some records.
0
 

Author Comment

by:zimmer9
ID: 34976066
I did a format cells for certain rows within the CORP/CMPY field and some rows are defined as
Custom   0###  (for ex:  0555)      other rows are defined as
Custom     ###  (for ex:  1534)     and still other rows are defined as
General            (for ex:   PPF)
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 34978184
> String is any of the above.

No.

> Typically you would use the Text or Memo.

No. You would use the Text or Memo.
Text is limited to 255 characters. Memo can hold much larger strings but is non-indexable.

/gustav
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now