View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default 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
|
|
|