Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Passing a value from 1 userform to another when you dont know who called it.

I have a user form that has several date entry TextBoxes. I have a
generic calendar userform that I call when one of the date text boxes
is selected. Basically I have a quote input form. I have text boxes to
capture the Date the request was sent, the date it was expected and the
date it was received. When I click on one of these text boxes my
generic calendar user form pops up and the user selects the date then
hits a enter date button. This is where my problem comes in. How do I
know where to return the date to? TextBox1,TextBox2, TextBox3.....? Is
there some way for the "Enter Date" button on the calendar userform to
know who invoked it and return the date to the correct text box? The
"Enter date" button code resides with the calendar user form not the
"Quote Request" userform that it was called from.

Thanks
Scott

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Passing a value from 1 userform to another when you dont know who

In the click event of the textbox that displays the calendar, do

Private Sub Textbox1_Click()
frmCalendar.Show
Textbox1.Value = format(frmCalendar _
.Calendar1.Value,"mm/dd/yyyy")
unload frmCalendar
end sub

in frmCalendar, rather than

Unload me
or
Unload frmCalendar

just hide it

Me.Hide
or
frmCalendar.hide

for example:

Private Sub btnEnterDate_click()
me.hide
End sub

--
Regards,
Tom Ogilvy

" wrote:

I have a user form that has several date entry TextBoxes. I have a
generic calendar userform that I call when one of the date text boxes
is selected. Basically I have a quote input form. I have text boxes to
capture the Date the request was sent, the date it was expected and the
date it was received. When I click on one of these text boxes my
generic calendar user form pops up and the user selects the date then
hits a enter date button. This is where my problem comes in. How do I
know where to return the date to? TextBox1,TextBox2, TextBox3.....? Is
there some way for the "Enter Date" button on the calendar userform to
know who invoked it and return the date to the correct text box? The
"Enter date" button code resides with the calendar user form not the
"Quote Request" userform that it was called from.

Thanks
Scott


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Passing a value from 1 userform to another when you dont know who

Perfect!!
I played with a public varialble to hold the selected date and it
worked but I didnt like setting it up that way.
I dont know why I didnt think to just have the click event code just
refer to the selected date on the calendar form. I had just hid it
before so it was there already for me to use.

Thanks a ton.......


Scott Riddle

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
Private Sub - Called from Userform pallaver Excel Discussion (Misc queries) 3 July 15th 08 08:41 AM
How to make userform disappear while called subroutine is running Cornelia Excel Programming 2 June 16th 06 10:47 PM
Function, dont know what its called Michael Excel Worksheet Functions 1 May 8th 06 09:47 PM
Passing parameters to a called add-in... Trevor[_4_] Excel Programming 1 June 11th 04 11:12 PM
Opening a UserForm causes a crash in the Exit procedure (Which is never called) Brent McIntyre Excel Programming 0 May 12th 04 12:37 PM


All times are GMT +1. The time now is 09:32 AM.

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"