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
313 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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
 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

821 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