Avatar of HKFuey
HKFuey
Flag 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.
Microsoft SQL Server 2008Microsoft Access

Avatar of undefined
Last Comment
HKFuey

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
TheAvenger

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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
TheAvenger

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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
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
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck