|
-
Oct 18th, 2002, 02:41 PM
#1
Thread Starter
Fanatic Member
Is it possible.....
to change the text colour on a RptTextBox if a value on run time is reached ie if the dates are a year before a the present date?
Thx
-
Oct 18th, 2002, 02:49 PM
#2
PowerPoster
What's an rptTextbox? Do you mean a richtextbox? If yes, then you can just check the date, and if it is past the current date using DateDiff, set the RTB's forecolor to the new color you want.
-
Oct 18th, 2002, 03:04 PM
#3
Thread Starter
Fanatic Member
Sorry....
a rpttextbox is used in a datareport
-
Oct 18th, 2002, 03:07 PM
#4
Software Eng.
Try
If DateDiff("d", Format(CDate(Text1), "mm/dd/yyyy"), Format(Now, "mm/dd/yyyy")) > 0 Then rtb.ForeColor = vbBlue
-
Oct 18th, 2002, 03:17 PM
#5
PowerPoster
He's not using an RTB... :hmmm: What does the rpttextbox do? I've never used datareports or grids before.
-
Oct 18th, 2002, 03:27 PM
#6
Software Eng.
Originally posted by MidgetsBro
He's not using an RTB...
Oops. I thought he just misspelled 'Rich' 
Anyhow, I think the principle should still be the same. Replace Text1 with the name of your control. I'm sure it will have some proprty for retrieving the text, and another property for the forecolor (not sure of the names though).
-
Oct 18th, 2002, 03:32 PM
#7
PowerPoster
Originally posted by Megatron
Oops. I thought he just misspelled 'Rich' 
Me too. That's why I mentioned the RTB in my first post as well...
-
Oct 18th, 2002, 04:55 PM
#8
Thread Starter
Fanatic Member
Hmmmm....
I wish I didnt use it either, used Crystle in VB5 now with VB6 and Im finding there's not a lot of people useing DataReport or they find crystle better.
thx anyway
-
Oct 18th, 2002, 05:03 PM
#9
Fanatic Member
I tried it out of curiousity and it had no effect.
I tried to set the font color to red at runtime.
It didn't generate an error, it just simply did nothing.
VB Code:
Private Sub DataReport_Activate()
rptROEA_Full.txtscore.ForeColor = &HFF&
End Sub
The txtscore should have appeared as txtScore. Since it didn't capitalize it when I moved off the line while I was coding, I was pretty sure it wouldn't reference it.
I too have found the DataReports to be lacking in many areas
"Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!
Resistance is futile, you will be compiled . . . Please!
-
Oct 18th, 2002, 05:37 PM
#10
Thread Starter
Fanatic Member
hmmm.......
does somone know MR B Gates telephone number?
-
Oct 22nd, 2002, 01:49 PM
#11
Fanatic Member
Hey, I finally got it to work!
Try this . . .
VB Code:
Private Sub DataReport_Initialize()
<ReportName>.Sections("<SectionName>").Controls("<ControlName>").ForeColor = &HFF&
DoEvents
End Sub
Simply insert your DataReport name, the SectionName that contains the rptTextBox and the actual name of the text box (ControlName)
(&HFF& is red)
Hope this helps!
"Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!
Resistance is futile, you will be compiled . . . Please!
-
Oct 22nd, 2002, 04:25 PM
#12
Thread Starter
Fanatic Member
-
Oct 22nd, 2002, 08:41 PM
#13
Fanatic Member
Re: Well done...
Originally posted by spud
I gave up on it a long time ago, if you dont mind me asking what are you using for reference, book or the net.
I was actually trying to change a label on a report of mine at runtime. The user clicks on an item in a listview and the report is generated based on parameters passed to the dataenvironment. I wanted the item clicked in the listview to be the heading for the report. I couldn't find in help on this one. Found it the old way - pulling out my hair and cursing!
Have you any idea how i can how i can get it to highlite indevidual text, say in the list the word "dog" appears how would you just highlite that text?
hmmmm, I'll take a peek!
"Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!
Resistance is futile, you will be compiled . . . Please!
-
Oct 22nd, 2002, 10:26 PM
#14
Thread Starter
Fanatic Member
had the same problem i used the title box and changed on the active datareport. seen youre other thred on database forum can use that as well.
Im trying to find ouy if there is abook out yet on database in VB6 with a comprohensive chapter on DataReport but as yet Nothing
-
Oct 23rd, 2002, 08:31 AM
#15
Fanatic Member
MSDN had a little bit on the data reports. Thier examples show very simple usages for using the data report including using functions on the data reports.
My needs quickly outgrew thier examples, but they are a start.
If you have MSDN on your computer, search for "Creating a Simple Data Report" from the search tab with "Visual Basic Documentation" selected for the Active Subset. There is an 8-page walk-through starting with that page.
I have not been able to find any really good examples or tutorials for advanced uses of the data report. Mostly I'm learning it by trial and error!
"Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!
Resistance is futile, you will be compiled . . . Please!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|