Active control Name

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?
 
M

Malcolm Cook

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
 
L

Luis

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?
 
L

Luis

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?



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top