LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Variable not seen

I cannot work out why the variable oStyle is not €˜seen by the message forms
cmdOkNo_Click procedure. Should be simple but I've gone blank:

From a form I call a custom message box form which can have a combination of
Yes, No, Cancel or OK cmdbuttons. However I use only 3 buttons by switching
No and Ok on the same button. The messaging and configuring of the message
box is done in a module:

Public Function oMsgBox1(oStyle As String, oNumPrompts As Long, Prompt1 As
String, Prompt2 As String, Prompt3 As String, Prompt4 As String, Title As
String)

€¦.code

End Function

The oStyle string can be €œOK€ or €œYNC€ or €œYN€

oStyle, boMsgYes, boMsgNo, and boMsgCancel are declared globally elsewhere.

In the message form code I have:

Private Sub cmdOkNo_Click()
If oStyle = "YN" Or oStyle = "YNC" Then ''' oStyle remains ""
boMsgNo = True
End If
other stuff
End Sub

Private Sub cmdYes_Click()
boMsgYes = True
other stuff
End Sub

Private Sub cmdCancel_Click()
boMsgCancel = True
other stuff
End Sub

T.I.A.

Geoff

 
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
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 10:26 AM.

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

About Us

"It's about Microsoft Excel"