Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    May 2003
    Location
    Bucharest
    Posts
    16

    Unanswered: how can you color a record in datasheet view?

    can you asign to a record a diffrent color in datasheet view???
    how?

    Thanks
    Theodor

  2. #2
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    I don't think you can but if you use continuous forms instead you can use colour.

  3. #3
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    You cannot unless you change the entire color scheme of datasheet view from tolls/options

    As far as continuous forms all colors are the same in each row unless you specifically change them using the on current event to then evaluate the conditions of that specific record
    Now you can define the colrs for the form in design mode , but these color schemes will apply to all the records in the continuous form unless you evalute the specific records criteria to change those fields.

  4. #4
    Join Date
    May 2003
    Location
    Bucharest
    Posts
    16

    i am sad that i can not do that color thing.

    anyway i want to mark some records to be very visible for users and i don't know haw.

    thanks anyway!
    Theodor

  5. #5
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    if it is one record in standard form view then

    behind the oncurrent event

    if currentuser = "whoever" then
    myfield.forecolor = vbwhite
    myfield.backcolor = vbwhite

    else

    myfield.backcolor = whatevercolor you want
    myfield.forecolor = whatevercolor you want

    end if


    this is not the best security but you could use the following code to hide the control alltogether

    if currentuser = "whoever" then
    myfield.visible = false
    else

    myfield.visible = true
    end if

  6. #6
    Join Date
    May 2003
    Location
    Bucharest
    Posts
    16

    i mistunderstand me

    i did not want to say visible for some users and hide for the others.
    i wanted to say distict color for records for users to see faster how many records are red (if red means someting).

    anyway i can handle this in other ways.

    Thanks
    Theodor

  7. #7
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    cannot do it with continuous forms

  8. #8
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    You can use the conditional formatting expression (if you have access 2k or XP) to change the colours of fields (or rows) in a continuous form if the condition you want is met.

    For one project I'm working I have a form with 14 continous forms (it's a planning form for a printing factory) that all have conditional formating to highlight the current staus of a job and it works fine.

  9. #9
    Join Date
    May 2003
    Location
    Bucharest
    Posts
    16

    thanks man

    thats exactly what i need.

    Thanks again!
    Theodor

  10. #10
    Join Date
    Jul 2003
    Posts
    25

    Question How can I

    Hi,

    I have a subform that is in table format. How do I compare fields within the subform with fields on the main form to highlight that if there is a difference between the data in the fields the subform field is highlighted red.


    If you can help me that would be much appreciated since I only have 2 more days to submit the DB for review.

    Many thanks

    regards

    Phil







    Originally posted by axsprog
    You cannot unless you change the entire color scheme of datasheet view from tolls/options

    As far as continuous forms all colors are the same in each row unless you specifically change them using the on current event to then evaluate the conditions of that specific record
    Now you can define the colrs for the form in design mode , but these color schemes will apply to all the records in the continuous form unless you evalute the specific records criteria to change those fields.

  11. #11
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    behind the ON Current event of the subform

    if me!myfield <> me.parent!field then
    myfield.backcolor = vbred
    myfield.forecolor = vbwhite
    else
    myfield.backcolor = 0
    myfield.forecolor = vbwhite
    end if

    I used black white and red - you could use any color you want

    also the data types "should" match what you are comparing

  12. #12
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    21

    Lightbulb

    omg your like this human code machine. . . .





    Originally posted by axsprog
    if it is one record in standard form view then

    behind the oncurrent event

    if currentuser = "whoever" then
    myfield.forecolor = vbwhite
    myfield.backcolor = vbwhite

    else

    myfield.backcolor = whatevercolor you want
    myfield.forecolor = whatevercolor you want

    end if


    this is not the best security but you could use the following code to hide the control alltogether

    if currentuser = "whoever" then
    myfield.visible = false
    else

    myfield.visible = true
    end if

  13. #13
    Join Date
    Jul 2003
    Posts
    25

    Smile Code

    axsprong and trin - many thanks

    axsprong - does the code let you highlight just that cell or the whole column because I just need the cell to be highlighted. Plus will this compare a subform field with a form field - Is there any chance that I can get an example because I really don't know where to find the ON Current event etc. pllllllllllllllease.


    Many thanks


    Phil

    Originally posted by axsprog
    behind the ON Current event of the subform

    if me!myfield <> me.parent!field then
    myfield.backcolor = vbred
    myfield.forecolor = vbwhite
    else
    myfield.backcolor = 0
    myfield.forecolor = vbwhite
    end if

    I used black white and red - you could use any color you want

    also the data types "should" match what you are comparing

  14. #14
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    is this subform in datasheet view or continuous form

    I prefer continuousform views

    much more flexibility such as what you want to do

    as for where to find the OnCurrent

    bring up the subform in design mode
    open the propert sheet
    click the events tab
    should be first item in the list
    click the 3 button ellipse and choose code if it does not already default to that

    make sure you substitute your actual filed names where I used myfield, etc

    some features of the datasheet view are under the control of tools/options

    so do not be surprised if some things do not work

    Like I said - continuous forms look better and have more flexibility

  15. #15
    Join Date
    Jul 2003
    Posts
    25

    Smile Code

    Hi,

    Thanks for the advide.

    I would prefere to do it in datasheet mode - can this be done and how?

    If you prefere the continuous form then that will be ok - but is there a chance that you can do an example for me plllllllease.

    Thanks again for your help, you have been very kind, thank you.

    Phil



    Originally posted by axsprog
    is this subform in datasheet view or continuous form

    I prefer continuousform views

    much more flexibility such as what you want to do

    as for where to find the OnCurrent

    bring up the subform in design mode
    open the propert sheet
    click the events tab
    should be first item in the list
    click the 3 button ellipse and choose code if it does not already default to that

    make sure you substitute your actual filed names where I used myfield, etc

    some features of the datasheet view are under the control of tools/options

    so do not be surprised if some things do not work

    Like I said - continuous forms look better and have more flexibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •