Discussion Locked

Convert numbers to text

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I'm writing a VB application to create customised price lists from an exported excel product list (40,000 items). Because the source data is sorted alpha-numerically my DAO control sets the data type to numeric and consequently ignores any alphabetic product codes. The opposite occurs if the list is reversed. At present I'm having to create a temporary copy of the product file with an extra column containing the formula =MID((""#"" & RC[1]),2,(LEN(""#"" & RC[1])-1))to force the text data type. Is there a cleaner way to do this using the recordsource property or some other method using VB?

5 replies

by choppit

Unfortunately my product list contains alpha and numeric codes so I need to ensure that the recordset is created using a text datatype.

by dklippert

Change the source data's extension to .DAT
Start record macro and import the data. Excel will bring up the Import wizard that allows you to set the data type for each field.
You will then have some import code that you may be able to adapt to your project.

This discussion is closed to new replies.