Results 1 to 6 of 6

Thread: Calendar (2003)

  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Calendar (2003)

    I can't quite figure out why my calendar control isn't working. It pops up, I can make a selection, but nothing happens (the date isn't changed and the calendar remains visible). Idea's?
    (Code attached)(references confirmed)
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Calendar (2003)

    The code you posted makes the calendar control visible and sets its value to the date in the text box, or if that is blank, to the current date. No less and no more.

    Is there any event procedure for the calendar control? It would look like

    Private Sub calCalendar_...

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Calendar (2003)

    Nope. . .and there isn't an event for the calendar contol in the db I "snuck" the code out of either. . .and it works just fine in that db. I must be missing something here (besides the brain cells I mean).
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Calendar (2003)

    Ooops. . .yes there is. Thanks for the hint (I found it by searching VB.

    Private Sub calCalendar_Click()
    ctlCaller.Value = calCalendar.Value
    ctlCaller.SetFocus
    calCalendar.Visible = False
    Set ctlCaller = Nothing
    End Sub
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Calendar (2003)

    Your code resembles that in <post:=441,897>post 441,897</post:>. As you can see there, you need code for the calendar. With the names from your code, it becomes:

    Private Sub calCalendar_Click()
    ctlCaller.Value = calCalendar.Value
    ctlCaller.SetFocus
    calCalendar.Visible = False
    Set ctlCaller = Nothing
    End Sub

    You must also have a declaration near the top of the module

    Private ctlCaller As TextBox

    (assuminhg that txtDate is a text box, as the txt prefix indicates)

  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Calendar (2003)

    I totally forgot about the declaration!!
    All is well, and thanks again for saving my $%#@!!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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