ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Return value from calendar to a label... (https://www.excelbanter.com/excel-programming/295646-return-value-calendar-label.html)

Steff_DK

Return value from calendar to a label...
 
Hi all,

I'm trying to use the calendar control to change the caption on
label.

I have one form containing the label.
I have another form with the calendar control on, and I want excel t
return the value from the form with the calendar control object to th
form with the label.

Why doesn't this work???

Private Sub Calendar1_Click()
stDeadline = Calendar1.Value
frmcalendar.Hide

With frmNytProjekt
Label10.Caption = stDeadline
End With

End Sub

Cheers

Steff_D

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Return value from calendar to a label...
 
Haven't tried it, but it looks okayish.

What do you get? Does the project form pop-up with Label10 in it, or
something else?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steff_DK " wrote in message
...
Hi all,

I'm trying to use the calendar control to change the caption on a
label.

I have one form containing the label.
I have another form with the calendar control on, and I want excel to
return the value from the form with the calendar control object to the
form with the label.

Why doesn't this work???

Private Sub Calendar1_Click()
stDeadline = Calendar1.Value
frmcalendar.Hide

With frmNytProjekt
Label10.Caption = stDeadline
End With

End Sub

Cheers

Steff_DK


---
Message posted from http://www.ExcelForum.com/




Steff_DK[_2_]

Return value from calendar to a label...
 
I get error '424' and 'Object required'.

It seems that excel won't return to the form with label10 after i
closes the form with the calendar?!

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Return value from calendar to a label...
 
Steff,

This works for me. I put .Show in so that I could see it worked

Private Sub Calendar1_Click()
Dim stDeadline

stDeadline = Calendar1.Value
frmCalendar.Hide

With frmNytProjekt
.Label10.Caption = stDeadline
.Show
End With

End Sub

Note the dot before Label10

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steff_DK " wrote in message
...
I get error '424' and 'Object required'.

It seems that excel won't return to the form with label10 after it
closes the form with the calendar?!?


---
Message posted from http://www.ExcelForum.com/




Steff_DK[_3_]

Return value from calendar to a label...
 
It works now!!!

Thanks a million - been sitting here for hours wondering why it didn'
work... (Forgot the dot!!! doooh...)

Stef

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Return value from calendar to a label...
 
Good. Oddly I didn't get the same error as you.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steff_DK " wrote in message
...
It works now!!!

Thanks a million - been sitting here for hours wondering why it didn't
work... (Forgot the dot!!! doooh...)

Steff


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com