Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing controls at run time

Status
Not open for further replies.

lizray

Programmer
May 14, 2008
126
AU
I have a text box whose content references a field, eg =[firstname}. I would like to change it at run time to other fields. e.g. =[surname]. I have another text box into which I type the new contents but when I copy them to the first text box, they do not reference the fields, but are treated as a text string. Is there a way to solve this ?
 
how about a textbox bound to each of the fields, lay them in exactly the same and size position then for each with a bit of coding have only one visible at any one time. changing their visblility using the afterupdate event.

alternatively have an unbound textbox and using the after update event save the data into the field.

Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Perhaps I should give the full picture. I want to print stickers and to be able to vary the content(Fields, punctuation etc)of the stickers at run time. I am trying to do this by typing the required content into a text box on a form and moving this to a text box on the report(in the Format event) that will cause the stickers to be printed
 
I tried that and the communication betweem report and form works, but it returns the exact text entered on the form textbox as a String in "" marks. I want to input some fieldnames with concatenated spaces etc
 
I don't understand how you would get the "" marks unless you typed them into the control on the form.

Can you provide more information? It seems you are revealing a little at a time like a scavenger hunt. You post a bit and we reply. You post more information and we reply. How about telling us what you want to accomplish, what you have, and why?

Duane
Hook'D on Access
MS Access MVP
 
I have outlined the full picture in an earlier reply...but I think it is too hard and will opt to have several "not visible" textboxes on the report, each containing the Fields and punctuation I might ned. On the format even I can then copy the apprpriate text box to the one used fro sticker output and this works ok but I have a new problem...how do I insert a new line into the string in a textbox. If I put
=[Firstname] & " " & [Surname] & vbcrlf & [Address]
access puts brackets around the vbcrlf and treats it as a field...which of course doesnt exit...Any Ideas
 
Solved it. I found out that for a Control Source you need ....& chr(13) & chr(10) &....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top