Userform and textboxes

P

Paul

Hi,

I'm working on a form which contains times and dates.

I got about 40 textboxes and after each textbox there is a commandbutton
which brings up a calender where people can fill out there times and dates by
clicking on it and it will fill out the times in the form. This works fine
for one entry in one textbox but........
I'm using a class module, I got from this forum, to call the calendar. So I
got one module that is used by 40 commandbuttons for 40 different textboxes.

Now I would like to achieve that I can designate for each commandbutton
where the calendar puts it's values after clicking

Is this possible? Anybody got any idea?

Thanks,

Paul
 
J

Joel

I would make the Class Module a function that returns a date. Remove from
the Class modules any direct writes to a text box and set the return value of
the Class Module the date.

from this
Sub GetDate()

textbox1.text = Date()
end Sub

to
Function GetDate()
GetDate = Date()
end sub

Or Pass the Name of the Textbox to the Class Module

Sub GetDate(TBox as string)

set tbox = oleobjects(Tbox)
tbox.text = Date()
end sub
 

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