Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Problem with modal forms

I have 2 forms, frmEdit and frmWait.

(frmEdit is opened modally.)  On frmEdit, when a user clicks on btnSave the program seems to stop when it opens frmWait.  (frmWait is just a form that informs the user to to wait while the progrm is saving)
'--------------------------
Private Sub btnSave_Click()

frmWait.show vbmodal

Call UpdateChanges

unload frmWait
Unload me

End Sub
'--------------------

I know that it has to do something with both forms being displayed modally.  If I changed it so that frmEdit is not opened modally in the beginning then the procedure will run correctly.  Can someone tell me how to make this work with frmEdit being opened modally.

thanks
0
sopheak
Asked:
sopheak
1 Solution
 
afpcosCommented:
The problem is because you are loading frmWait modally.  This causes all processes to stop in the parent form until the child form is closed.

Break the saving functions out into other functions besides the sub that loads frmWait.  Create a Public function in frmEdit that will start the 'saving process'.  Load frmWait modally.  On Form Activate of frmWait, call the Public function in frmEdit that will start the save process, then close the frmWait form.

Hope this helps.
0
 
sopheakAuthor Commented:
thanks
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now