PC Review


Reply
Thread Tools Rate Thread

(ADO)Getting data from access database Memo field

 
 
Mike
Guest
Posts: n/a
 
      30th Dec 2008
Tax-82.54 Disc-0 Online-206.50
Instant-503.00‡CC-146‡‡Visa-139.14‡MC-‡Debit-187.26‡‡PM-3.00‡RJR-‡Lor-‡S&M-‡USST-7.00‡Other-‡Total Coupons-10.00‡Safe Fund- 300.00

I need to take the string above and break it up to look like this below
Im trying to put this into a multiline textbox. Im guessing the cross
looking things are the enterkey. Some single and some double in this example.
There could be more then that in the database.
If someone could help me i would appreciate it.

Tax-82.54 Disc-0 Online-206.50 Instant-503.00
CC-146

Visa-139.14
MC-
Debit-187.26

PM-3.00
RJR-
Lor-
S&M-
USST-7.00
Other-
Total Coupons-10.00
 
Reply With Quote
 
 
 
 
Nigel
Guest
Posts: n/a
 
      30th Dec 2008
One solution......

Sub FillList()
Dim sT As String, sO As String
Dim iC As Integer

sT = "Tax-82.54 Disc-0 Online-206.50
Instant-503.00‡CC-146‡‡Visa-139.14‡MC-‡Debit-187.26‡‡PM-3.00‡RJR-‡Lor-‡S&M-‡USST-7.00‡Other-‡Total
Coupons-10.00‡Safe Fund- 300.00"

With Sheets("Sheet1").ListBox1
.Clear
For iC = 1 To Len(Trim(sT))
If Asc(Mid(sT, iC, 1)) <> 135 Then
sO = sO + Mid(sT, iC, 1)
Else
.AddItem sO
sO = ""
End If
Next
End With
End Sub

--

Regards,
Nigel
(E-Mail Removed)



"Mike" <(E-Mail Removed)> wrote in message
news:886DE1CE-AA95-47FA-85A2-(E-Mail Removed)...
> Tax-82.54 Disc-0 Online-206.50
> Instant-503.00‡CC-146‡‡Visa-139.14‡MC-‡Debit-187.26‡‡PM-3.00‡RJR-‡Lor-‡S&M-‡USST-7.00‡Other-‡Total
> Coupons-10.00‡Safe Fund- 300.00
>
> I need to take the string above and break it up to look like this below
> Im trying to put this into a multiline textbox. Im guessing the cross
> looking things are the enterkey. Some single and some double in this
> example.
> There could be more then that in the database.
> If someone could help me i would appreciate it.
>
> Tax-82.54 Disc-0 Online-206.50 Instant-503.00
> CC-146
>
> Visa-139.14
> MC-
> Debit-187.26
>
> PM-3.00
> RJR-
> Lor-
> S&M-
> USST-7.00
> Other-
> Total Coupons-10.00


 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      4th Jan 2009
Nigel
It works good except it leaves off the last part of the string
"Safe Fund- 300.00"
Any ideas

"Nigel" wrote:

> One solution......
>
> Sub FillList()
> Dim sT As String, sO As String
> Dim iC As Integer
>
> sT = "Tax-82.54 Disc-0 Online-206.50
> Instant-503.00‡CC-146‡‡Visa-139.14‡MC-‡Debit-187.26‡‡PM-3.00‡RJR-‡Lor-‡S&M-‡USST-7.00‡Other-‡Total
> Coupons-10.00‡Safe Fund- 300.00"
>
> With Sheets("Sheet1").ListBox1
> .Clear
> For iC = 1 To Len(Trim(sT))
> If Asc(Mid(sT, iC, 1)) <> 135 Then
> sO = sO + Mid(sT, iC, 1)
> Else
> .AddItem sO
> sO = ""
> End If
> Next
> End With
> End Sub
>
> --
>
> Regards,
> Nigel
> (E-Mail Removed)
>
>
>
> "Mike" <(E-Mail Removed)> wrote in message
> news:886DE1CE-AA95-47FA-85A2-(E-Mail Removed)...
> > Tax-82.54 Disc-0 Online-206.50
> > Instant-503.00‡CC-146‡‡Visa-139.14‡MC-‡Debit-187.26‡‡PM-3.00‡RJR-‡Lor-‡S&M-‡USST-7.00‡Other-‡Total
> > Coupons-10.00‡Safe Fund- 300.00
> >
> > I need to take the string above and break it up to look like this below
> > Im trying to put this into a multiline textbox. Im guessing the cross
> > looking things are the enterkey. Some single and some double in this
> > example.
> > There could be more then that in the database.
> > If someone could help me i would appreciate it.
> >
> > Tax-82.54 Disc-0 Online-206.50 Instant-503.00
> > CC-146
> >
> > Visa-139.14
> > MC-
> > Debit-187.26
> >
> > PM-3.00
> > RJR-
> > Lor-
> > S&M-
> > USST-7.00
> > Other-
> > Total Coupons-10.00

>
>

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      6th Jan 2009
Oops, add the line (third from bottom) to fix that.

Sub FillList
With Sheets("Sheet1").ListBox1
.Clear
For iC = 1 To Len(Trim(sT))
If Asc(Mid(sT, iC, 1)) <> 135 Then
sO = sO + Mid(sT, iC, 1)
Else
.AddItem sO
sO = ""
End If
Next
If Len(Trim(sO)) > 0 then .additem sO '< this line to fix
End With
End Sub


--

Regards,
Nigel
(E-Mail Removed)



"Mike" <(E-Mail Removed)> wrote in message
news:29D3A7F2-7FD4-48FF-AEB3-(E-Mail Removed)...
> Nigel
> It works good except it leaves off the last part of the string
> "Safe Fund- 300.00"
> Any ideas
>
> "Nigel" wrote:
>
>> One solution......
>>
>> Sub FillList()
>> Dim sT As String, sO As String
>> Dim iC As Integer
>>
>> sT = "Tax-82.54 Disc-0 Online-206.50
>> Instant-503.00‡CC-146‡‡Visa-139.14‡MC-‡Debit-187.26‡‡PM-3.00‡RJR-‡Lor-‡S&M-‡USST-7.00‡Other-‡Total
>> Coupons-10.00‡Safe Fund- 300.00"
>>
>> With Sheets("Sheet1").ListBox1
>> .Clear
>> For iC = 1 To Len(Trim(sT))
>> If Asc(Mid(sT, iC, 1)) <> 135 Then
>> sO = sO + Mid(sT, iC, 1)
>> Else
>> .AddItem sO
>> sO = ""
>> End If
>> Next
>> End With
>> End Sub
>>
>> --
>>
>> Regards,
>> Nigel
>> (E-Mail Removed)
>>
>>
>>
>> "Mike" <(E-Mail Removed)> wrote in message
>> news:886DE1CE-AA95-47FA-85A2-(E-Mail Removed)...
>> > Tax-82.54 Disc-0 Online-206.50
>> > Instant-503.00‡CC-146‡‡Visa-139.14‡MC-‡Debit-187.26‡‡PM-3.00‡RJR-‡Lor-‡S&M-‡USST-7.00‡Other-‡Total
>> > Coupons-10.00‡Safe Fund- 300.00
>> >
>> > I need to take the string above and break it up to look like this below
>> > Im trying to put this into a multiline textbox. Im guessing the cross
>> > looking things are the enterkey. Some single and some double in this
>> > example.
>> > There could be more then that in the database.
>> > If someone could help me i would appreciate it.
>> >
>> > Tax-82.54 Disc-0 Online-206.50 Instant-503.00
>> > CC-146
>> >
>> > Visa-139.14
>> > MC-
>> > Debit-187.26
>> >
>> > PM-3.00
>> > RJR-
>> > Lor-
>> > S&M-
>> > USST-7.00
>> > Other-
>> > Total Coupons-10.00

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo format field data problem - Data import from Access database AFSSkier Microsoft Excel Programming 0 29th Apr 2009 05:51 PM
Importing Excel Data Into MS Access Memo Field Mike S. S. Microsoft Access External Data 2 22nd Feb 2009 10:07 PM
Access database Memo data types Sanjib Biswas Microsoft ADO .NET 2 5th Nov 2005 01:49 PM
Losing data in Access memo field =?Utf-8?B?SmVycnk=?= Microsoft Access Forms 0 23rd Dec 2004 02:23 PM
save a XML file into a memo field in a access database Larry Microsoft VB .NET 0 1st May 2004 03:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 AM.