Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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
|
|
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
One command in one cell initiating another command in another cel. Chas52 Excel Worksheet Functions 3 November 7th 09 06:57 PM
command code ( GOTO command) in formula calan New Users to Excel 1 June 11th 09 09:44 AM
Pivot Table Error Message - "Command Text not set for command obje Jeff Divian Excel Discussion (Misc queries) 0 November 7th 07 10:26 PM
Excel to load COMMAND and type a Run Command? [email protected] Excel Programming 5 August 22nd 06 10:47 PM
activeform dfixemer Excel Programming 1 December 29th 04 03:43 PM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"