Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

    I have a continues form. In that form there will be records who have the same date.
    I want that records with the same date has a other collor (font or background) than the other records who has a different date.
    See printscreen in attachement, this is an example how I want it.
    Is this possible in access?

    thanks on advance
    Attached Images Attached Images

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Nancy,

    I think this is not possible in a continuous form or in datasheet view. With some VBA, you could achieve this in a report.
    Francois

  3. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello Ciske,
    Thanks for the reply, I thought it was no possible, but the customer asked for it.

    grts Nancy

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Check out this database and see if you can use it.
    Attached Files Attached Files

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Hi Pat,

    That database was originally created and posted by me (freely using ideas from others); I don't think it will help Nancy (plutoken) directly - to do what she wants would be quite complicated. As Francois remarked, it can be realized more easily in a report.

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I can think of a couple of options that use Conditional Formatting, based on a hidden control that counts the number of records with the same date.

    [attachment=87140:Entries.gif]

    (I have only applied the conditional formatting to the date, but it could be applied elsewhere)

    Setting the Control Source of the hidden control to:

    Code:
    =DCount("entryID","tblEntries","[Entrydate]=#" & Format([entrydate],"mm/dd/yyyy") & "#")
    Would allow you to to able to Add New records, and Edit existing records in this form, but would probably be slow if there is much data.

    If the form is just used for viewing records, then a query that counts records by date, would be a much faster way to provide the count.
    Attached Images Attached Images
    Regards
    John



  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    John, your suggestion would highlight records with the same date as the one in the current record.

    If I interpret Nancy's request correctly, records would be highlighted alternatingly according to the date field. That is not the same.

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Hans, I agree with your interpretation of Nancy's request, but I don't think you are right about my solution. Here is another screenshot.
    Current record is entry 1, but other records are highlighted based on the Date.

    [attachment=87141:Entries2.gif]
    Attached Images Attached Images
    Regards
    John



  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Quote Originally Posted by John Hutchison View Post
    Current record is entry 1, but other records are highlighted based on the Date.
    Sorry, I misunderstood - but I still don't think it's what Nancy asked. As far as I can tell, she'd want the records for the 6th highlighted, but not those for the 7th, etc. as in this screenshot:

    [attachment=87142:x.png]
    Attached Images Attached Images
    • File Type: png x.png (1.7 KB, 2 views)

  10. #10
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    OK I have read her post again, and I think I got it wrong. I thought she wanted to highlight any record where the date was repeated.
    Regards
    John



  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Well, let's see what she says...

  12. #12
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nancy,

    I have been searching a little and I think I have to change my mind. Look at the attached mdb and see if you can do something with it.
    I wrote a function to add a Boolean field to the recordset. That field change from true to false and vice versa each time the date change in the date field. Once that field is created, it's easy to use the conditional formating to change the backcolor of each field in the form.

    HTH

    [attachment=87145:AlternateColors.zip]
    Attached Files Attached Files
    Francois

  13. #13
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello Francis,
    I have opend your example of form and that is exactly what I want.
    I will give it a try in my database and let you know if it worked.

    Many many thanks.

    grts Nancy

  14. #14
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello Francis,

    I works just fine your code, exept, in my database it is just the "alternate" field that is colored, not the whole row.
    If you want I can upload my database. But it is in access 2007.

    I have an extra question, can I determe which color it should be? Now it is default yellow.

    Thanks on advance.

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Francois uses conditional formatting on the text boxes. You should apply the same conditional formatting to all text boxes (and combo boxes) in the detail section.
    You can change the fill color in the conditional formatting dialog.

Page 1 of 2 12 LastLast

Posting Permissions

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