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
Solved

Concatenate text box value in a command button caption

Posted on 2008-10-24
4
346 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
  • 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 250 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 250 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

840 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