Results 1 to 15 of 15

Thread: Is it possible.....

  1. #1

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Question 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
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  2. #2
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

  3. #3

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Talking Sorry....

    a rpttextbox is used in a datareport
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  4. #4
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286
    Try

    If DateDiff("d", Format(CDate(Text1), "mm/dd/yyyy"), Format(Now, "mm/dd/yyyy")) > 0 Then rtb.ForeColor = vbBlue

  5. #5
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    He's not using an RTB... :hmmm: What does the rpttextbox do? I've never used datareports or grids before.
    <removed by admin>

  6. #6
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286
    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).

  7. #7
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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...
    <removed by admin>

  8. #8

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    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
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  9. #9
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    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:
    1. Private Sub DataReport_Activate()
    2.     rptROEA_Full.txtscore.ForeColor = &HFF&
    3. 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!

  10. #10

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Talking hmmm.......

    does somone know MR B Gates telephone number?
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  11. #11
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    Hey, I finally got it to work!

    Try this . . .

    VB Code:
    1. Private Sub DataReport_Initialize()
    2.     <ReportName>.Sections("<SectionName>").Controls("<ControlName>").ForeColor = &HFF&
    3.     DoEvents
    4. 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!

  12. #12

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Talking Well done...

    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


    thx again I think you should get your 1000 threds reinstated.
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  13. #13
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857

    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!

  14. #14

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Wink

    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
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  15. #15
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    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
  •  



Click Here to Expand Forum to Full Width