Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Curious error....modal/nonmodal

Status
Not open for further replies.

slwolf8

Technical User
Apr 23, 2001
82
US
The sequence of events in my macros is basically this:

Sub Main()
frmPatent.show
End Sub

Private Sub cmdFinish_Click()
frmPatent.hide
frmWait.show (modal)

Unload frmWait
Unload frmPatent
End Sub

Upon execution of Sub Main I get RTE 401 "Can't show non-modal form when modal form is displayed" Why is this? I don't have a modal form yet in Sub Main and then when I do introduce the modal form I unload it before unloading the non modal form...I'm confused.
 
is there any other coding in that click event? Cause that usually happens if you havent unloaded a modal form yet and you are trying to load another form.
 
Yes, there is other code in the click event, but it doesn't involve any forms. The only modal form I have in the project is the frmWait one.
 
I think your problem is due to the line:

frmWait.show (modal)

modal is interpreted as a variable, with value 0, which is the value for vbModeLess. Did you mean

frmWait.show vbModal?

At any rate, you don't have to specify vbModal, it's the default.


Rob
[flowerface]
 
That is a good example of why you should always have
Code:
    Option Explicit
as the first line in every code module.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top