Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    ghiasibrahim is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2018
    Location
    Damascus
    Posts
    14

    exactly. that's it.

  2. #17
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    For all I know, it is very late where you are and rather than wait, I went ahead, assuming I understand the current problem. Since you are using 2 background colours for days, it becomes more difficult if you have to distinguish between weekends and weekdays. The distinction doesn't have to be made when changing to yellow (or whatever). It becomes a problem when deciding what to put it back to, and that depends on weekend or not. So here's what I think you need, based on changing the font colour instead. Replace the red line with the following
    Code:
    If i = DatePart("d", Date) + 3 And CLng(Me.cboMonth) = DatePart("m", Date) Then
       Controls(strCtlName).ForeColor = vbRed
    Else
       Controls(strCtlName).ForeColor = vbBlack
    End If
    If you want to continue on with altering the background, I leave it to you to do the tests for weekdays versus weekends. Other than the font, I suppose you could alter the border, or make it appear sunken, or any combination of those. Note that by using specific colours as alternates, they will over-ride generic settings such as "Text 1" which you have in your other controls. This means that for one user, the altered font may appear black while the rest are "Text 1", which depends on system settings. If all users are restricted to the same system settings and Text 1 is black in the theme, there should be no visual conflict. To ensure you avoid this, you would set all textboxes to an actual colour value that will match what you're using in code. In this case, all calendar textboxes would have a value from the Standard list, such as #000000, and not the themes list. You can do all of these controls at once by selecting all of them first.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #18
    ghiasibrahim is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2018
    Location
    Damascus
    Posts
    14
    Yes it's perfect man. thank you so much for everything.
    you are very kind person.
    wish you very good time watching world cup matches
    all the best

  4. #19
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You're welcome. We all try to help so I'm not better/different than anyone else here.
    But I don't follow soccer - just the hapless Blue Jays (MLB). To be fair, they have their good days, just having swept the Nationals over 3 games!

  5. #20
    ghiasibrahim is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2018
    Location
    Damascus
    Posts
    14
    Dear Micron I would like to mention, that I have done some Correction to the Code like the following try it I think it's more better.

    If i = DatePart("d", Date) + intFirstWeekday - 2 And CLng(Me.cboMonth) = DatePart("m", Date) And CLng(Me.cboYear) = DatePart("yyyy", Date) Then Controls(strCtlName).BackColor = vbYellow Else Controls(strCtlName).BackColor = vbWhite

    as you see the variant intfirstweekday will correct the code.
    All the best my friend>

  6. #21
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Thanks for sharing your solution.
    Good luck with your db.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 02-01-2018, 03:10 AM
  2. Replies: 5
    Last Post: 02-04-2017, 07:34 AM
  3. Replies: 2
    Last Post: 04-29-2016, 09:06 PM
  4. Replies: 2
    Last Post: 12-22-2015, 09:09 PM
  5. Replies: 2
    Last Post: 04-20-2013, 03:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums