-
I have two forms one is frmMain, it is the main form, the second is frmAdvanced, it is to set the advanced settings. What I'm trying to do is when the settings are changed on the advanced settings form, I want to see the changes on the main form. It is things like turning a toolbar or statusbar from visible to not visible. I can get it to work if I exit the enitre program and re-open the program. I'm saving all of the settings to a text file. But I want to see the changes with out exiting the program. This is the code from the frmAdvanced form to turn on or off the status bar if the the box is checked:
Private Sub chkStatusbar_Click()
If chkStatusbar.Value = 1 Then
frmMergeMain.mnuViewStatusBar.Checked = True
frmMergeMain.mnuViewStatusBar.Visible = True
Else
frmMergeMain.mnuViewStatusBar.Checked = False
frmMergeMain.mnuViewStatusBar.Visible = False
End If
End Sub
When I leave the advanced form and return to the main form the status bar is either still there, if it was there in the first place or not there if it was not there.
HELP please.
-
i'm not sure exactly what you want to do, but are you making the variables global so they can be used by both forms?
-
Do I have to make them global when I'm calling the form that they are part of and changing the information that way?? If I want to turn the toolbar off so that I don't see it, from an other form how would you do it??
-
public myVar as boolean
if checked then myVar = false
if myVar = true then
do whatever
else
whatever
-
HeSaidJoe
Where will this code go on the main form or the advanced form?? This could be where I'm going wrong, I might have the code on the wrong forms
-
I add my public declares in a bas module
then it's available everywhere
in the form activateof main i would put
if whatever is checked then myVar = false
if myVar = ture then do
bla bla
else
bla bla
endif
in the frmActivae of the advance
if myVar = false do whatever
else
do
something else
endif
in the check box
if chkMe = chekced then myVar =
gotta go...system crash...
will check later on thei
should have the idea from this
later
-
HeSaidJoe, Thank you very much. I'll let you know how it goes.
-
sorry
...I'm at work so I had to go...
Basically, you want to set the value of myVar in your checked and unchecked states and that makes it available to both forms..then you want to check the value in both form activates and act on it at that point.
-
Okay, I see what I'm doing wrong. I'm missing that myVar part. A bas module is just a basic module right?? Thank you ever so much for all of your help. One more question, ini files have you ever used them??
I'm at work too so I understand. :-)
-
over and out...
yes..add module ..saves as .bas
no..never played with them
good luck
-
Thanks again for all your help!!!!!!!!!!!