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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Form Caption

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
How can I set the caption of a form to a textbox value. I want the caption to change as the records change.<br><br>Ex: txtJobNumber = 00-100<br><br>&nbsp;Form Caption: Job Number: 00-100<br><br>&nbsp;&nbsp;&nbsp;&nbsp;txtJobNumber = 00-101<br><br>&nbsp;Form Caption: Job Number: 00-101<br><br>Thanks to all<br><br>
 
use the forms on Current Event and add this code:<br><br>Form.Caption= &quot;Job Number: &quot; & txtJobNumber
 
Simple, under the On Current property of your form, go into the Code Builder (just click on the &quot;...&quot; and choose Code Builder), then put in the VB code:<br><b><br>Me.Caption = &quot;Job Number &quot; & Me.[Job Number]<br></b><br><br>You can just cut and paste this formula in there, if your actual field name is &quot;Job Number&quot; otherwise change it to your actual field name.&nbsp;&nbsp; <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Correction, you may have to use the formula<br><b><br>Me.Caption = &quot;Job Number &quot; & Me.Job_Number<br></b><br><br>I avoid spaces in my field names, so i'm not positive which way it should be.<br> <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top