PDA

View Full Version : Solved: Active Control or text box ???



jammer6_9
02-22-2008, 11:40 PM
I am having 20 text boxes in a userform (my Mainform), In each "KeyPress" event of the text box, I am calling a "Monthview Calendar" that is in another userform and what I wanted is when I click on the calendar, the value should go to that active text box... How can I do that?


Private Sub MonthView1_DateClick(ByVal DateClicked As Date)

frmMain.ActiveControl.Value = calendar.MonthView1.Value
Me.Hide

End Sub

gwkenny
02-23-2008, 12:01 AM
Could post the workbook or take a gander at the thread: http://vbaexpress.com/forum/showthread.php?t=17939

In Leave_Request_1.7.xls he does exactly what you want.

If you open the file click the button "Submit Leave Request Form" and double click in the "start" textbox.

Then examine the code behind it, it's pretty easy :)

Cheers

jammer6_9
02-23-2008, 12:15 AM
Definitely it gives me what I wanted... Thanks...


Could post the workbook or take a gander at the thread: http://vbaexpress.com/forum/showthread.php?t=17939

In Leave_Request_1.7.xls he does exactly what you want.

If you open the file click the button "Submit Leave Request Form" and double click in the "start" textbox.

Then examine the code behind it, it's pretty easy :)

Cheers