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

Color in a text box 3

Status
Not open for further replies.

SheepDog

Programmer
Feb 4, 2003
232
US
Using this code below for a text box in a report can I make the Name: in red and the First_Name and Last_Name in black?

="Name : " & [FIRST_NAME] & " " & [LAST_NAME]
 
Please change the one line of code that parses the variable strFirst to the following:

Code:
strFirst = Mid$(.Value, 7, intPosition - 7)

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Bob:
Your fix made the correction I was going to write back on because it was listing the first and last name twice. Currently there is a text box that shows up around the name how do I get it to have no text box around the name when i display the report. Is it through the code you sent or the properties of the text box.
I know the other text boxes I have I have not had to do anything with their properties in order to have no text box show up.
 
Comment out the link at the bottom of the code that begins with "Me.Line =". Just put an apostrophe in from the Me and no box will be drawn. You see the box is drawn here in code if you want it. Notice the comment above the code explaining what they are doing there.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
The text box have helped me with has a different font, color.
How do I make it the text box we have worked on the same as the others? it must be in the code you sent but did not see where I can put in bold, arial and the color od red that is which is 128.
 
It uses the control properties that are set at the time you design the report. We are not changing any of them. Make sure that the control has the correct properties that you want.

Please be more specific. Is your control changing to a different font with this code as it shouldn't

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Bob:
If you had an e-mail I would send a screen shot of what I have so you can see it.
 
See my profile.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Bill:
Put the red code below in front of the black line of code.

Code:
[red].FontBold = True
.FontName = "Arial"
.ForeColor = 128[/red]
Me.Print strLabel;

Let me know if this works for you. I don't think the font needs changing but we can put it in there. Just by changing the Bold the font will look the same.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Bob:
I have tried sveral scenerio's with code to add more text boxes and have them like the one in the code above with no luck.
If I have text box named txtAddress with the following fields what the code above look like. I have tried adding duplicate code but with the information needed below only to get errors
="Address: " & [ADDRESS_LINE_1] & " " & [ADDRESS_LINE_2]
 
Each control on the line is a seperate set of code to print the format properly. You must parse each control to seperate varaibles and then modfify the adjustments to the print properties just before performing the me.print; of each variable. In addition the X and y coordinates of the control must be stored just prior to the printint of each control. This is key. It must be reset with the beginning of the printing of each control set of variables.

Good luck.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top