Multiple forms and focus

G

Guest

I have form A which opens Modal form B which opens Modal form C. On modal
form C is a command button. Button Code:

Private Sub cmdViewMainEmployee_Click()

Dim stDocName As String

Me.REASON_CODE.SetFocus

stDocName = "frmD"

DoCmd.OpenForm stDocName, acNormal, , , acFormPropertySettings, ,
Me.EMPLOYEE_SSN.Value

DoCmd.SelectObject acForm, stDocName

Forms![frmD]![EMPLOYEE SSN].SetFocus

End Sub

As you can see the command button opens Modal form D. The problem is that
Modal form D opens up behind modal form C. The only way to work with the
form is to close modal form C. I'm beginning to think this some sort of bug.
Since forms B and C open and work properly. The only difference is that form
D has a menu bar.

Thanks for your help.
 
G

Guest

I forgot to add another piece of information. Form C is opened as modal
dialog, because once it's closed I want to do some associated processing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top