Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Calendar Not Appear On First Call


I'm using a calender control (v12) in a userform in XL2007. I'm not using a
separate userform for this calendar but included it as part of an initial
form asking for name, account #, and statement log date range. Name and
account # are selected from a dropdown and the form has two command buttons
for the Beginning and Ending dates of the log.

I take the Beginning and Ending date and concat them into a text string that
I display on the userform and again on the printout.

Note: This only happens when the form is first opened.

The problem: The calendar.visible is "false" at start up. When the Begin
button is clicked, the calendar does not show. When clicking in the area,
where the calendar should be, I get a day to appear, so this leads me to
believe that the visiblity call is working but the calendar is not showing.

If I initially double click on the begin button, the calendar shows but the
header with month and year are transparent.

If I click a date from either of the two above situations, the calendar is
turned off, as it should. When the Ending button is clicked, the full
calendar appears and everything is fine.

Also, you'll notice a reset button, it's there if it's needed by the user
and this is working fine.

Thx in advance, JG

Here's the code: (I apologize in advance if it's remedial but I don't make
my living doing this. :-)...)

Private Sub StmtDtBegButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
End Sub

Private Sub StmtDtEndButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
End Sub

Public Sub StmtDtResetButton_Click()
With DateTxt
.Visible = False
.Value = ""
End With
BegDt = ""
EndDt = ""
StmtDates = ""
StmtDtBegButton.Visible = True
StmtDtEndButton.Visible = True
StmtDtResetButton.Visible = False
Label4.Visible = False
End Sub

Private Sub Calendar1_Click()
If DateTxt.Value = "" Then
StmtDtBegButton.Visible = False
StmtDtResetButton.Visible = True
BegDt = Format(Calendar1.Value, "mm/dd/yy")
Calendar1.Visible = False
DateTxt.Value = BegDt
Else
StmtDtEndButton.Visible = False
EndDt = Format(Calendar1.Value, "mm/dd/yy")
Calendar1.Visible = False
End If
If BegDt < "" And EndDt < "" Then
StmtDates = BegDt & " To " & EndDt
With DateTxt
.Value = StmtDates
.Visible = True
End With
Label4.Visible = True
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Calendar Not Appear On First Call


add the indicated line...

Private Sub StmtDtBegButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
Me.Repaint 'ADD THIS
End Sub

"John G." wrote in message
...
I'm using a calender control (v12) in a userform in XL2007. I'm not using
a
separate userform for this calendar but included it as part of an initial
form asking for name, account #, and statement log date range. Name and
account # are selected from a dropdown and the form has two command
buttons
for the Beginning and Ending dates of the log.

I take the Beginning and Ending date and concat them into a text string
that
I display on the userform and again on the printout.

Note: This only happens when the form is first opened.

The problem: The calendar.visible is "false" at start up. When the Begin
button is clicked, the calendar does not show. When clicking in the area,
where the calendar should be, I get a day to appear, so this leads me to
believe that the visiblity call is working but the calendar is not
showing.

If I initially double click on the begin button, the calendar shows but
the
header with month and year are transparent.

If I click a date from either of the two above situations, the calendar is
turned off, as it should. When the Ending button is clicked, the full
calendar appears and everything is fine.

Also, you'll notice a reset button, it's there if it's needed by the user
and this is working fine.

Thx in advance, JG

Here's the code: (I apologize in advance if it's remedial but I don't make
my living doing this. :-)...)

Private Sub StmtDtBegButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
End Sub

Private Sub StmtDtEndButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
End Sub

Public Sub StmtDtResetButton_Click()
With DateTxt
.Visible = False
.Value = ""
End With
BegDt = ""
EndDt = ""
StmtDates = ""
StmtDtBegButton.Visible = True
StmtDtEndButton.Visible = True
StmtDtResetButton.Visible = False
Label4.Visible = False
End Sub

Private Sub Calendar1_Click()
If DateTxt.Value = "" Then
StmtDtBegButton.Visible = False
StmtDtResetButton.Visible = True
BegDt = Format(Calendar1.Value, "mm/dd/yy")
Calendar1.Visible = False
DateTxt.Value = BegDt
Else
StmtDtEndButton.Visible = False
EndDt = Format(Calendar1.Value, "mm/dd/yy")
Calendar1.Visible = False
End If
If BegDt < "" And EndDt < "" Then
StmtDates = BegDt & " To " & EndDt
With DateTxt
.Value = StmtDates
.Visible = True
End With
Label4.Visible = True
End If
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Calendar Not Appear On First Call


Patrick...that was just the kick that it need. That's for help. JG

"Patrick Molloy" wrote:

add the indicated line...

Private Sub StmtDtBegButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
Me.Repaint 'ADD THIS
End Sub

"John G." wrote in message
...
I'm using a calender control (v12) in a userform in XL2007. I'm not using
a
separate userform for this calendar but included it as part of an initial
form asking for name, account #, and statement log date range. Name and
account # are selected from a dropdown and the form has two command
buttons
for the Beginning and Ending dates of the log.

I take the Beginning and Ending date and concat them into a text string
that
I display on the userform and again on the printout.

Note: This only happens when the form is first opened.

The problem: The calendar.visible is "false" at start up. When the Begin
button is clicked, the calendar does not show. When clicking in the area,
where the calendar should be, I get a day to appear, so this leads me to
believe that the visiblity call is working but the calendar is not
showing.

If I initially double click on the begin button, the calendar shows but
the
header with month and year are transparent.

If I click a date from either of the two above situations, the calendar is
turned off, as it should. When the Ending button is clicked, the full
calendar appears and everything is fine.

Also, you'll notice a reset button, it's there if it's needed by the user
and this is working fine.

Thx in advance, JG

Here's the code: (I apologize in advance if it's remedial but I don't make
my living doing this. :-)...)

Private Sub StmtDtBegButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
End Sub

Private Sub StmtDtEndButton_Click()
With Calendar1
.Value = Date
.Visible = True
End With
End Sub

Public Sub StmtDtResetButton_Click()
With DateTxt
.Visible = False
.Value = ""
End With
BegDt = ""
EndDt = ""
StmtDates = ""
StmtDtBegButton.Visible = True
StmtDtEndButton.Visible = True
StmtDtResetButton.Visible = False
Label4.Visible = False
End Sub

Private Sub Calendar1_Click()
If DateTxt.Value = "" Then
StmtDtBegButton.Visible = False
StmtDtResetButton.Visible = True
BegDt = Format(Calendar1.Value, "mm/dd/yy")
Calendar1.Visible = False
DateTxt.Value = BegDt
Else
StmtDtEndButton.Visible = False
EndDt = Format(Calendar1.Value, "mm/dd/yy")
Calendar1.Visible = False
End If
If BegDt < "" And EndDt < "" Then
StmtDates = BegDt & " To " & EndDt
With DateTxt
.Value = StmtDates
.Visible = True
End With
Label4.Visible = True
End If
End Sub


Reply
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
On call calendar question CJC Excel Discussion (Misc queries) 1 November 21st 08 09:06 PM
Call Calendar Steen Excel Programming 7 February 3rd 07 07:04 PM
Call Calendar Steen Excel Programming 2 February 1st 07 10:44 PM
Call up form calendar form VBA Bob Phillips Excel Programming 3 January 21st 07 10:50 PM
call up a calendar icebreaker914 Excel Programming 3 April 30th 05 03:27 AM


All times are GMT +1. The time now is 05:57 PM.

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

About Us

"It's about Microsoft Excel"