Passing Variables through Custom Dialog Boxes

X

Xiazer

I have a Custom form Options Popup appear whenever an "Options" Comman
button is pressed on my main page. Now within this Popup there ar
several options that the user will be able to manipulate. Although
can't get the values to pass back from the popup.

On the main page there is a "Calculate" button that does all th
calculations, that leads to a Private Sub that does all the work. S
basically Im asking can I get a custom form options to work with m
spreadsheet

here is some code, I hope it helps

Private Sub cmdOpts_Click()
Load SSheduleOpt 'Load the Form into memory
SSheduleOpt.Show 'Show the form on screen
End Sub

This is where the popup appears although it does appear but it does no
affect my spreadsheet yet.

Private Sub cmdCalcWD_Click()
Dim SSheet As New SSched

' create an instance of your class object
'Set SSheet = New SSched

'Functions to actually work the Spreadsheet
cmdClear_Click 'Clears the workspace
SetDays SSheet 'Sends SShet Variable to the SetDays Su
Routine
End Sub
This one is the Calculate button, don't mind the custom class, but
just want to know how to tie my options menu into "SetDays" Sub. M
brain is kinda scattered (Long Day of coding) so if it doesn't mak
sense let me know I'll Edit it.

Thanks in advance
 
W

Wendell A. Clark

Embed your databoxes on the form then address them through form.property
setups like
Range.("A1").Value = Form1.Textbox1.text
or constructs in that vein -- ;-)


--
Wendell A. Clark, BS
-------------------------------------

CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may
contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient,
please notify us by reply e-mail. You are hereby notified that you have
received this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its contents is prohibited.
If you have received this communication in error, please destroy all copies
of this communication and any attachments. Contact the sender if it
continues.
 
W

Wendell A. Clark

you can add to them before you Show the dialogue and read them back before
you release the memory

--
Wendell A. Clark, BS



-------------------------------------

CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may
contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient,
please notify us by reply e-mail. You are hereby notified that you have
received this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its contents is prohibited.
If you have received this communication in error, please destroy all copies
of this communication and any attachments. Contact the sender if it
continues.
 
X

Xiazer

If I write my code so that it doesn't unload the form could that kee
the options that the users set? I really wanted to avoid storin
information on the spreadsheet, i really want to keep it all in VBA. i
it possible to do that
 
X

Xiazer

I'm hoping that I can find an easier way to do this but best I am doing
is having On Change update the Spreadsheet
 
W

Wendell A. Clark

Xiazer,

When you load the form

you can manipulate its data (text/cobo/lists-boxes)

then you display it to the user and they can see the data that you allowed.

when they click [ok] the form -- You can cause the form to be 'hidden' so
that the data remains in the background.

then If you want to use the data elsewhere as well you can :
1. build a small class with protected properties (keeping -- your data
unalterable except by you -- or your code)
- or -
1. you can set a global-variable that is visible to all code-segments
(yours or others)

when you unload the form the class instantiation or the global-variable
(dependent upon where you initialized it) will remain in memory (although
usually inaccessible)

setting the form to nothing actually releases all references to the
memory -- any further attempt to use it will either error-out or cause a
rebuild of the form


--
Wendell A. Clark, BS

-------------------------------------

CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may
contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient,
please notify us by reply e-mail. You are hereby notified that you have
received this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its contents is prohibited.
If you have received this communication in error, please destroy all copies
of this communication and any attachments. Contact the sender if it
continues.
 
W

Wendell A. Clark

You will want to load when you open the sheet ,

hide in the middle once you've set your variables
and unload when you close ;-)
--
Wendell A. Clark, BS
-------------------------------------

CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may
contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient,
please notify us by reply e-mail. You are hereby notified that you have
received this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its contents is prohibited.
If you have received this communication in error, please destroy all copies
of this communication and any attachments. Contact the sender if it
continues.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top