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

How do I edit a text box based on the beginning character of another

Status
Not open for further replies.

MICKI0220

IS-IT--Management
Jul 20, 2004
337
US
I have a text box on a report that needs read SB based on whether or not the text of the description text box starts with the character "#". I have tried different combo's of code none of which put anything in the box. Below is an example of what I have tried.

If IMDESC.Text = "[#]*" Then txtSB.Text = “SB”
End If

Any assistance is greatly appreciated.
 
There is no reason to use code for this. Also, the Text property of a control is only available on forms when the control has the focus.

What do you want displayed if the 1st character is not #?

Set the control source of the text box to:
Code:
=IIf(Left(IMDESC,1)="#","SB",Null)

Duane
Hook'D on Access
MS Access MVP
 
If the first character is not # then I don't want anything displayed. Thanks for the info, I will try it in a little bit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top