Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Calendar Contol with mutiple textboxes

I am using the Textbox_Entyer event to trigger the frmCalender to appear and when a date is selected
it places the date into Textbox1

However further down on the form i have another date textbox (Textbox33)

How can use the SAME frmCalendar to input the date here into Textbox33 as with Textbox1 ?

As the code line i am using to input the date from the Calendar is :


Private Sub Calendar1_Click()
With UserForm1
TextBox1.Value = Calendar1.Value
Unload Me
End Sub

Is there a way to have something like:

Activetextbox or If textbox.setfocus = true then

They did not work though

I do not want to add a2nd frmCalendar


Corey....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Calendar Contol with mutiple textboxes

Hi Corey

I don't have the calendar control installed on this computer but i
believe the code below should work for you though i can't test it as i
said.

Option Explicit
Dim Ctrl As MSForms.Control

Private Sub TextBox1_Enter()
Set Ctrl = UserForm1.Controls("TextBox1")
'call calendar control
End Sub

Private Sub TextBox33_Enter()
Set Ctrl = UserForm1.Controls("TextBox33")
'call calendar control
End Sub

Private Sub Calendar1_Click()
Ctrl.Value = Calendar1.Value
Unload Me
End Sub

hope this helps

S

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
Running mutiple excel sheets on mutiple computers Lost Excel Discussion (Misc queries) 3 January 16th 09 12:32 AM
Accessing Mutiple TextBoxes TimBro[_4_] Excel Programming 1 October 4th 04 11:13 AM
Accessing Mutiple TextBoxes TimBro[_3_] Excel Programming 1 October 1st 04 05:56 PM
Accessing Mutiple TextBoxes TimBro[_2_] Excel Programming 0 October 1st 04 03:16 PM
Accessing Mutiple TextBoxes TimBro Excel Programming 1 October 1st 04 01:57 PM


All times are GMT +1. The time now is 12:51 AM.

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"