ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform and textboxes (https://www.excelbanter.com/excel-programming/413020-userform-textboxes.html)

Paul

Userform and textboxes
 
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

joel

Userform and textboxes
 
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
"Paul" wrote:

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



All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com