PC Review


Reply
Thread Tools Rate Thread

Calendar Not Appear On First Call

 
 
John G.
Guest
Posts: n/a
 
      3rd Jul 2009

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 With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      3rd Jul 2009

add the indicated line...

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

"John G." <(E-Mail Removed)> wrote in message
news5BC3AF6-05FB-4C6A-B21D-(E-Mail Removed)...
> 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 With Quote
 
John G.
Guest
Posts: n/a
 
      3rd Jul 2009

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." <(E-Mail Removed)> wrote in message
> news5BC3AF6-05FB-4C6A-B21D-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
On call calendar question CJC Microsoft Excel Misc 1 21st Nov 2008 09:06 PM
Call Calendar =?Utf-8?B?U3RlZW4=?= Microsoft Excel Programming 7 3rd Feb 2007 07:04 PM
Call Calendar =?Utf-8?B?U3RlZW4=?= Microsoft Excel Programming 2 1st Feb 2007 10:44 PM
call up a calendar =?Utf-8?B?aWNlYnJlYWtlcjkxNA==?= Microsoft Excel Programming 3 30th Apr 2005 03:27 AM
On Call Calendar Jerry Camel Microsoft Outlook Contacts 0 2nd Mar 2005 08:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:40 PM.