View Single Post
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Jophy,

This works according to your code, but your description differs, when you
say two buttons to fire your calendar.

Do you have two calendar controls, and are they hidden until you click the
buttons.
#Private Sub Calendar1_Click()
With Me
If .TextBox5.TabIndex = 9 Then
.TextBox5.Text = Calendar1.Value
Else
.TextBox6.Text = Calendar1.Value
End If
End With
End Sub

BTW unloading the form in the click event doesn't seem like a good idea, you
will never see the result.

--
HTH

Bob Phillips

"jophy j via OfficeKB.com" wrote in message
...

Thanks Bob Phillip for your prompt reply... Still Iam not clear.. I have
coded as follows

Private Sub Calendar_Click()
If userform2.textbox5.tabindex=9
UserForm2.TextBox5.Text = Calendar.Value
else
UserForm2.TextBox6.Text = Calendar.Value
endif
Unload Me
End Sub

Calendar invokes when a button press.. Once you select date ,this date

should
move to appropriate input boxes as there are two input date box.. I have
created two buttons (to popup calendar) near each inputbox.
When I click first button,the date shoud go to textbox5 and click on the
secon button should go to textbox6.

Regards
Jophy



Bob Phillips wrote:
Not quite clear on this.

When a control is invoked (entered), the events for that control fire. So
normally you would add code to the events for the specific control. So,

the
user would type into Textbox1 say, and you could code in the Change, Exit
events, or any of the other events associated with a textbox.

Hi,
I am a new member in this group.. I have some dificulties

in
form's date input box. I am trying to get date from a calendar and

there are
two date input box. How do I pass the dates into respective input

boxs. How
do I check the cursor whether is in Textbox1 or Textbox2 ?



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200507/1