ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there an ActiveForm command? (https://www.excelbanter.com/excel-programming/380992-re-there-activeform-command.html)

Jim Rech

Is there an ActiveForm command?
 
I need the calendar to update the TextBox

I think that's the wrong approach. You should have the calling form update
itself.

--
Jim
"Trevor Williams" wrote in
message ...
|I have 2 forms. Both forms have a button that calls a calendar control.
|
| The calendar Close Event is set to update a TextBox on UserForm 1 - which
is
| fine if UserForm1 is open.
|
| I need the calendar to update the TextBox on the form that is currently
| open. Is there a function like 'ActiveForm' that I can use?
|
| Thanks
|
| Trevor Williams



Jim Rech

Is there an ActiveForm command?
 
frmCalendar should have a public variable that it puts the user's choice in.
After the user is done with the calendar and clicks OK or Cancel you should
hide (not unload) it. Control will return to the calling userform. It can
then get the value from the public variable:

userChoice = frmCalendar.ReturnVariable

--
Jim
"Trevor Williams" wrote in
message ...
| Hi Jim
|
| Not sure I know what you mean?
|
| I need the calendar control to update a textbox on either UserForm1 or
| UserForm2, depending which one the control was triggered from.
|
| Currently the code specifies UserForm1 (frmOrderForm):
|
| Private Sub Calendar1_Click()
| frmOrderForm.TextBox10.Value = Format(Calendar1.Value, "dd/mm/yyyy")
| End Sub
|
| I'm looking to do someting along the lines of
ActiveForm.TextBox10.Value...
| but ActiveForm is not an option.
|
| Trevor
|
|
| "Jim Rech" wrote:
|
| I need the calendar to update the TextBox
|
| I think that's the wrong approach. You should have the calling form
update
| itself.
|
| --
| Jim
| "Trevor Williams" wrote in
| message ...
| |I have 2 forms. Both forms have a button that calls a calendar
control.
| |
| | The calendar Close Event is set to update a TextBox on UserForm 1 -
which
| is
| | fine if UserForm1 is open.
| |
| | I need the calendar to update the TextBox on the form that is
currently
| | open. Is there a function like 'ActiveForm' that I can use?
| |
| | Thanks
| |
| | Trevor Williams
|
|
|




All times are GMT +1. The time now is 08:35 PM.

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