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
Printable View
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
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.
a rpttextbox is used in a datareport:o
Try
If DateDiff("d", Format(CDate(Text1), "mm/dd/yyyy"), Format(Now, "mm/dd/yyyy")) > 0 Then rtb.ForeColor = vbBlue
He's not using an RTB... :hmmm: What does the rpttextbox do? I've never used datareports or grids before.
Oops. I thought he just misspelled 'Rich' ;)Quote:
Originally posted by MidgetsBro
He's not using an RTB...
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).
Me too. That's why I mentioned the RTB in my first post as well... :DQuote:
Originally posted by Megatron
Oops. I thought he just misspelled 'Rich' ;)
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
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:(
does somone know MR B Gates telephone number?:D
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!
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.
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?
Please dont bust a gut trying to work it out, but if you are up to a chalange then crack on:D
thx again I think you should get your 1000 threds reinstated.:p
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!Quote:
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.
hmmmm, I'll take a peek!Quote:
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?
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:mad:
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!