Active control Name

  • Thread starter Thread starter Luis
  • Start date Start date
L

Luis

Hello.
I have a form with several text boxes. What i'm trying o
do is when i double click on a textbox a form with the
calendar control opens. Then the user chooses a date and
clicks OK. Then the Form with the calendar closes and the
chosen date will be place on the textbox the users has
double clicked. Since i have several text boxes i'm trying
to get the name of the textbox i've double clicked and
then i put the value with the command Forms!
MyForm.Controls!MyControl.value=date_chosen.
Can i replace MyControl with a variable (for example) that
has the contrl name?
 
Luis,

I would consider using the double click even of each of the text boxes.

They will look like:

Private Sub myfirsttextbox_DblClick(Cancel As Integer)

myfirsttextbox = Call YourDisplayCalendarProcHere

End Sub

Good luck
 
Ok, i'm trying to use this event on each text box but i'm
still doesn't manage to do that.
When you say
"myfirsttextbox = Call YourDisplayCalendarProcHere"
The "YourDisplayCalendarProcHere" only opens the calendar?
And how can i get the chosen date from the calendar?
 
I've done it!

Thank you all.

-----Original Message-----
Ok, i'm trying to use this event on each text box but i'm
still doesn't manage to do that.
When you say
"myfirsttextbox = Call YourDisplayCalendarProcHere"
The "YourDisplayCalendarProcHere" only opens the calendar?
And how can i get the chosen date from the calendar?



.
 
Back
Top