paste data at end in field

L

lmv

Is there some code that would append or paste at the end of any existing data
in a field?
If there is already txt in the field ie
referinfo reads "someone else at this number"
by clicking a cmd button I want it to add "old; "
right now I have a button with the following it works fine obviously if
nothing is in the field but it overwrites if there is already txt in the
field.

Me!ReferInfo = "old: "

I was looking for a simple solution... I don't know vba code for append at
the end of the field if there is such a thing

Thanks
 
J

Jeff Boyce

It sounds as though you are trying to add multiple facts into a single
field. This isn't good database design.

If you have more than one "fact", consider revisiting your table design. To
get the best use of Access' relationally-oriented features/functions, you
need to feed it well-normalized data.

More than one fact implies more than one record...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
L

lmv

It is a note memo field thanks for the input but I still need to know IF it
is possible.
 
J

Jeff Boyce

Yes, possible. No, not recommended.

Please consider an alternative:

A table of notes, with [NoteDate], [Note], [NoteTaker] fields. One
record for each note, and no potential corruption from use of the memo
field...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

John Spencer

Sure. It's possible.

Me!ReferInfo = ME.ReferInfo & " old: "

If you want to add a new line in there
Me!ReferInfo = (ME.ReferInfo + Chr(13) + Chr(10)) & " old: "


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

John W. Vinson

Is there some code that would append or paste at the end of any existing data
in a field?
If there is already txt in the field ie
referinfo reads "someone else at this number"
by clicking a cmd button I want it to add "old; "
right now I have a button with the following it works fine obviously if
nothing is in the field but it overwrites if there is already txt in the
field.

Me!ReferInfo = "old: "

I was looking for a simple solution... I don't know vba code for append at
the end of the field if there is such a thing

Thanks

Jeff's point is very well taken, but you could add "old:" to the existing
string using

Me!ReferInfo = Me!ReferInfo & "old:"

This will replace

someone else at this number

with

someone else at this numberold:

so if you want a blank separating it, use " old:" instead.

But again... Jeff's right, your current design is very suspect.
 
L

lmv

Thank you John and John. I appreciate the input as to why something might not
be advisable HOWERVER it is nice to have the question answered at the same
time reasons are given why you don't advise it. Every situation is different
and just to write that you shouldn't do something without an answer smacks of
not knowing the answer in which case why bother to post at all? If the answer
is known and not given then it is a "control" issue and can't we just let
people take knowledge and decide for themselves? In my case the answer is
received and I will weigh out the pro/con. Thanks again! I do appreciate the
ANSWER & constructive help!
 
J

Jeff Boyce

I suppose that's one way to interpret ...

Another might be that understanding the implications lets you make an
informed decision...

Best of luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

Jeff Boyce

.... and if you perceived my response as a "control" issue, I apologize.
That wasn't my intent.

As my spouse will testify, I tend to be very linear. Until I've heard from
you that you understand the limitations, I have no reason to assume that you
do.

As other responders point out, an undate query will do what you're asking.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top