Results 1 to 7 of 7
  1. #1
    larek is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    4

    Custom calendar - select multiple dates


    This is my first post so hi everyone

    I've found popup calendar made by Allen Browne (attached). I want to get only numbers of the selected days (any form of highlight would be very nice) - for example: 1,13,20,21,30
    Is there any way to modify that userform to achieved this?
    Any help much appreciated

    Ps. Sorry fo my english I hope you understand me

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    yes you can modify it. but if you're a beginner, that would be tough for you. what are you doing? any other way you can do this stuff? e.g. - get the input you need from your users and do your operations that you need to?

  3. #3
    larek is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    4
    I'm not a completely beginner I've got some experience in programming in Excel VBA (I'm using custom calendars in my other Excel projects).
    I've started rogramming in Access just few weeks ago.
    Of course there is another way to do this but I wanted to try with calendar first.
    Any tips where to start?

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    so you want to select more than one date, right?

    well, the red circle you see is a label control. this:

    Code:
    Private Function ShowHighligher(ctlName As String)
    On Error GoTo Err_Handler
        Const lngcVOffset As Long = -83
    
        With Me(ctlName)
            Me.lblHighlight.Left = .Left 'CHANGES HORIZONTAL POS OF RED CIRCLE
            Me.lblHighlight.Top = .Top + lngcVOffset 'CHANGES VERTICAL POS OF RED CIRCLE
        End With
    
    Exit_Handler:
        Exit Function
    
    Err_Handler:
        Call LogError(Err.Number, Err.Description, conMod & ".ShowHighligher")
        Resume Exit_Handler
    End Function
    changes it's position based on what day you click. soooooo, you have to make more controls like that if you want more red circles. dynamically creating controls is not easy, nor is it standard. Same concept if you want to highlight the different dates you want. then you need a button that says something like "select dates", I'm sure.

    so that's probably where you start if you want to use AB's calendar for multiple dates.

  5. #5
    larek is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    4
    dynamically creating controls is not easy
    I tried few times - it caused me more truble then benefits so I think I'll pass

    I was thinking about changing the BackColor of the selected days. Can you tell me where and how to modify the code?

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    if you look at the calendar form, you'll see that every day is a label box. behind day 5, on the CLICK event, it says:

    Code:
    =SetSelected("lblDay05")
    so basically all you need to do is change that for each of those boxes. the change would look like:

    Code:
    =SetSelected("lblDay05")
    (the same obviously, but the control name you would use again in the proc. and color the back of it). the proc. would change like so:

    Code:
    Private Function SetSelected(ctlName As String)
    On Error GoTo Err_Handler
    
        me(ctlName).backcolor = RGB(255,0,0) 'use whatever color here
        Me.txtDate = DateSerial(Year(txtDate), Month(txtDate), CLng(Me(ctlName).Caption))
        Call ShowHighligher(ctlName) 'this is the red circle.  probably don't need this call now
    
    Exit_Handler:
        Exit Function
    
    Err_Handler:
        Call LogError(Err.Number, Err.Description, conMod & ".SetSelected")
        Resume Exit_Handler
    End Function

  7. #7
    larek is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    4
    Strange but I can't change the BackColor of the labels
    The combination of the SpecialEffect and FontBold will do
    Thanks for your patience and help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Update dates for multiple (not all) records
    By thekruser in forum Access
    Replies: 2
    Last Post: 08-30-2010, 05:27 PM
  2. Calendar to and From Dates
    By bobfin in forum Reports
    Replies: 10
    Last Post: 08-05-2010, 07:05 PM
  3. Replies: 2
    Last Post: 05-24-2010, 06:47 PM
  4. Replies: 2
    Last Post: 04-23-2010, 01:31 AM
  5. Select last 2 dates of service
    By kfinpgh in forum Queries
    Replies: 1
    Last Post: 11-25-2009, 07:34 PM

Tags for this Thread

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