?
Solved

Concatenate text box value in a command button caption

Posted on 2008-10-24
4
Medium Priority
?
349 Views
Last Modified: 2013-11-28
Is it possible to capture the value of a text box (text box data type is text)  and concatenate this to the caption in a command button?
If I have a text box with the value 1234 and I want a command button to concatenate this value in a command button caption saying Print Unit 1234 report is this possible. I tried several way and cant make it work, is this not allow in Access VBA?
0
Comment
Question by:Exl04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:SIGLR-Guy
ID: 22796158
You have to set the button's caption by code, after the lost focus event of the text box.
0
 
LVL 1

Accepted Solution

by:
SIGLR-Guy earned 1000 total points
ID: 22796179
I was talking about th lost focus event in case you actually allow the text field to be edited. But otherwise, you need to identify the event you want to use (one that fires after the text has been set in the field) to then change the button's caption through code.

Hope this helps.
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 total points
ID: 22796289
you can use the textbox afterupdate event

private sub textboxName_afterupdate()

me.commandbuttonname.caption="Print Unit " & me.textboxname & " report"

end sub
0
 
LVL 1

Author Closing Comment

by:Exl04
ID: 31623604
Thank you guys! both where correct
Thanks for let me learn from you guys.
IgnBan
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question