LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 2003 - MS Calendar Control VBA weirdness

I have a VBA form that I added 2 text boxes to determine a date range. In
those boxes, it calls a calendar control that's initially invisible. Here's
the code:

Dim sWhere As String
Private Sub tbFrom_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
cal1.Visible = True
sWhere = "From"
End Sub

Private Sub tbThru_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
cal1.Visible = True
sWhere = "Thru"
End Sub

Private Sub cal1_Click()
If sWhere = "From" Then
tbFrom.Text = cal1.Value
Else
tbThru.Text = cal1.Value
End If
sWhere = ""
cal1.Visible = False
End Sub

What's not happening is when I 'mouse down' over either of the text boxes,
the calendar doesn't come up. If I click in the area where the calendar
control is located, then it selects a date even though I can't see what date
I'm selecting. From then it works as expected.
What am I missing? I've tried to put the same code in "dbl-click" and
"change" and still get the same result.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Form with Calendar Control - Excel 2002 to 2003 compatibility TRE Excel Programming 4 October 10th 08 10:04 AM
calendar control excle 2003 sreenivas reddy Excel Worksheet Functions 1 August 16th 06 01:58 PM
Calendar Control in Excel 2000 can't display date in Excel 2003? Lewis Excel Discussion (Misc queries) 0 April 21st 06 05:07 PM
Backwards compatibility with Excel 2003 Calendar Control Whiskey Tango Foxtrot Excel Programming 4 March 21st 06 01:18 AM
calendar control xls 2003 peter Excel Programming 1 June 16th 04 03:10 AM


All times are GMT +1. The time now is 03:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"