By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,157 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,157 IT Pros & Developers. It's quick & easy.

Problem concatenating memo fields in MS access database

P: n/a
I have an access database form where I have a button that is supposed
to be appending the contents of 1 memo field to another is behaving
non-predictably. The code is:

Me![ToDo] = Me![ToDo] & Chr$(13) & Chr$(10) & Me![Studies1] &
Chr$(13) & Chr$(10) & Me![Studies2]
Me![Meds] = Me![MedsEntered] & Chr$(13) & Chr$(10) & Me![IVF] &
Chr$(13) & Chr$(10) & Me![Diet]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70

Any thoughts on what I'm doing wrong? Could there be a casting problem?
(I just want to append the text of 1 field to another field - am I
actually assigning objects this way?)

Any help would be greatly appreciated.

GH
gh********@yahoo.com

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I have managed this in a report without the $ sign
e.g.
=[FirstName] & " " & [lastname] & Chr(13) & Chr(10) & IIf([job title] Is Not
Null,[job title] & Chr(13) & Chr(10),"")

It does not use memo fields but I would think they would work OK?

James
<gh********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have an access database form where I have a button that is supposed
to be appending the contents of 1 memo field to another is behaving
non-predictably. The code is:

Me![ToDo] = Me![ToDo] & Chr$(13) & Chr$(10) & Me![Studies1] &
Chr$(13) & Chr$(10) & Me![Studies2]
Me![Meds] = Me![MedsEntered] & Chr$(13) & Chr$(10) & Me![IVF] &
Chr$(13) & Chr$(10) & Me![Diet]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70

Any thoughts on what I'm doing wrong? Could there be a casting problem?
(I just want to append the text of 1 field to another field - am I
actually assigning objects this way?)

Any help would be greatly appreciated.

GH
gh********@yahoo.com

Nov 13 '05 #2

P: n/a
gh********@yahoo.com wrote in
news:11**********************@f14g2000cwb.googlegr oups.com:
I have an access database form where I have a button that is
supposed to be appending the contents of 1 memo field to another
is behaving non-predictably. The code is:

Me![ToDo] = Me![ToDo] & Chr$(13) & Chr$(10) & Me![Studies1] &
Chr$(13) & Chr$(10) & Me![Studies2]
Me![Meds] = Me![MedsEntered] & Chr$(13) & Chr$(10) & Me![IVF]
&
Chr$(13) & Chr$(10) & Me![Diet]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70

Any thoughts on what I'm doing wrong? Could there be a casting
problem? (I just want to append the text of 1 field to another
field - am I actually assigning objects this way?)


What error are you getting?

Do the controls displaying the memo data have the same names as the
underlying memo fields that they display? If so, then you've got an
ambiguity that could cause a problem, since Access may be confused
about whether you are referring to the control or the field in the
record behind the form.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #3

P: n/a
Ted
Also, you may want to change your Chr(10) & Chr(13) commands to just "
& vbCrLf " for Carriage Return and Line Feed.
I would have written it:
Me!ToDo = Me!ToDo & vbCrLf & Me!Studies1 & vbCrLf & Me!Studies2
Me!Meds = Me!MedsEntered & vbCrLf & Me!IVF & vbCrLf & Me!Diet
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord,, acMenuVer70
Ted

Nov 13 '05 #4

P: n/a
"Ted" <be*****@gmail.com> wrote in
news:11**********************@g47g2000cwa.googlegr oups.com:
Also, you may want to change your Chr(10) & Chr(13) commands to
just " & vbCrLf " for Carriage Return and Line Feed.
I would have written it:
Me!ToDo = Me!ToDo & vbCrLf & Me!Studies1 & vbCrLf & Me!Studies2
Me!Meds = Me!MedsEntered & vbCrLf & Me!IVF & vbCrLf & Me!Diet
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord,,
acMenuVer7


I'd replace the DoMenuItem with:

Me.Dirty = False

Menus are for people, not for code.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.