Adding info to field

Novice1

Registered User.
Local time
Today, 13:26
Joined
Mar 9, 2004
Messages
385
I have a field that's automatically updated with "canned" info when a double-click on a button I created.

I want to build a series of buttons to add various "canned" info to the same field. Is this possible without deleting the information already in the field? If so, how? If not, any suggestions?
 
couple options

Hi,

I have done this a few times. One method is to call a Macro (from code)which basically moves to the field first, sends a bunch of BACKSPACES and then stops the Macro and continues the code you are running to dump in the new data. Not the best way, but it works.

Another way would be to change the value of the field in code:

Myfeild=""
then refersh the screen
then dump the test you have in for that button.

HTH
JimH
 
Sounds like you want to append (i.e., concatenate) the new text to the existing text in a field, yes?

If you want the new text to follow the existing text, then use an expression similar to this:
txtMyText = txtMyText & myNewCannedText​
where txtMyText is the name of the control that contains the text you wish to manipulate and myNewCannedText is the string you wish to add.

If you want the new text to precede the existing text, switch the expression around:
txtMyText = myNewCannedText & txtMyText​

Of course, you might wish to add some sort of separator between the old and new text. Perhaps a line feed ( chr(10) ) or at least a space or two.
 
Works like a charm

Thanks ... one problem ... the chr(10) or vbCR creates a character rather than a line break. Is there another code I can use?

Thanks again
 

Users who are viewing this thread

Back
Top Bottom