Link to home
Start Free TrialLog in
Avatar of HKFuey
HKFueyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL 2008 add notes field

Hi,
I'm looking for some advice on the data format to use for notes added to a record.

My code adds a date stamp and text and these are displayed in a text box on an Access form.

It looks like this:
23/05/12 Note3 24/05/12 Note2 22/05/12 Note1

How do I make it look like this: -
23/05/12 Note3
24/05/12 Note2
22/05/12 Note1

I tried using & VBCr but this does not seem to work.
ASKER CERTIFIED SOLUTION
Avatar of TheAvenger
TheAvenger
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HKFuey

ASKER

OK, when I print the results (immediate window) I get new lines for each comment.

But the text box just concatenates them all!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Hamed Nasr
try this click event of a button:
Assume field name v = "23/05/12 Note3 24/05/12 Note2 22/05/12 Note1"

Private Sub Command5_Click()
    Dim ar() As String  ' array to hold substrings
    Dim i, j As Integer
    ar = Split(v, " ")
    i = UBound(ar())
    For j = 0 To i - 1 Step 2
        Debug.Print ar(j), ar(j + 1)
    Next j
End Sub
Avatar of HKFuey

ASKER

I used a combination  of Chr(10) or Chr(13)  and Enter Key Behavior to New Line. It now works! (I did have Chr(13) or Chr(10)  the other way round as well)
Thanks