Michael Peters wrote:
What do you want it to look like in Access?
Do you want the first 3 numbers or the 2nd?
I want them to look as they are meant, i.e. like the first 3 numbers
I think you're going to have to format that data in Excel prior to
importing.
they are formatted as text. It doesn't have to do anything with formatting.
The problem is that line breaks in Excel are chr(10) whereas in Access they
are chr(13)chr(10). I need some setting that translates that. If these were
intelligent programs, they would translate it like that by default. <sigh>
-Michael
You want some bit of software to read your mind? Hmm... sounds dodgy.
Personally, I'd try to split the stuff out in Excel, or use something
like this:
Public Sub TruncCHR10()
Dim rs As DAO.Recordset
Dim vData As Variant
Dim intCounter As Integer
Set rs = DBEngine(0)(0).OpenRecordset("SELECT PK, NumberList FROM
xlsTestData;", dbOpenForwardOnly)
Do Until rs.EOF
vData = Split(rs.Fields("NumberList"), Chr(10))
For intCounter = LBound(vData) To UBound(vData)
Debug.Print rs.Fields("PK"), vData(intCounter)
Next intCounter
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Sub
But instead of just printing the split data to the debug window, write
it to a child table, where it belongs. And then you can query etc
without a clairvoyant computer.