Thread: type mismatch
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Janis Janis is offline
external usenet poster
 
Posts: 360
Default type mismatch

I didn't have the name of the okay button okay either. thanks,

"stevebriz" wrote:

1/ ensure you have declared boooleanflag1 to booleanflag3 as boolean
eg: Dim booleanflag1 as boolean
2/remove the spaces ...in all like this booleanflag 1= false to be
like booleanflag1
the cmd okay should have
3/ if the name ( not caption ) of your command button is Okay then
you sub should be

private sub Okay_click()

If booleanflag1= true and booleanflag2=true and booleanflag3=true then
unload me
Else
msgbox " All options must be completed before closing"
End if
End Sub

Janis wrote:
I have a user form with 3 option buttons. the flags are declared in the
declaraitons


option button1 click()
booleanflag 1= false
subproceduresXXXX
booleanflag 1 =true

option button 2 click()
booleanflag 2 =false
other subprocedures XXXX
booelanflag 2= true

option button 3 click()
booleanflag 3 = false
last procedures
booleanflag 3 = true

I have a commad button named "okay". If they click all the option then okay
it should
close but I get a type mismatch here. What should i do? All the
subprocess work. Why is it a type mismatch? THANKS,

Private Sub cmdOkay_Click()
If Flag1 = True & Flag 2 = True & Flag 3= True Then Unload Me
End Sub