Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Pop Up Calendar

Status
Not open for further replies.

jrobin5881

Technical User
Mar 10, 2004
228
US
Good Morning,

I have a pop up calendar that appears when an image is clicked on the user form.
Code:
Private Sub Image1_Click()
frmCalendar.Show
End Sub

and this is working correctly. I want the date that the user selects to be transferred to a text box control that I have next to the calendar image on the user form. I named my text box txtDate and when I test my code I get the following error message, " Compile error: Variable not defined" which I don't understand why this occurs?

Here's my code
Code:
[COLOR=red yellow]Private Sub Calendar1_Click()[/color red yellow]
' Transfer date selected on calendar to active cell
' and close UserForm.
    [COLOR=red yellow]txtDate.Value[/color red yellow] = Calendar1.Value
    Unload Me
End Sub

should I first pass the value to variable and then pick up the value in my text box???

 
Prefix it with the name of the form it's on e.g.
Code:
Userform1.txtDate.Value = Calendar1.Value
Hope this helps


HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Harley thanks so much... I kind of got stuck in the weeds there and needed a set of fresh eyes. It's working fine now. Thank you again.
 
No worries, glad I could help [smile]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top