Access Access - DoCmd OpenForm and focus

Joined
Apr 21, 2012
Messages
3
Reaction score
0
I call a form from a sub form on Form1 by clicking on a Hyperlink, passing the linked value as a filter in the DoCmd.OpenForm statement:

strSql = "SELECT tblMarker.*, tblLot.LotNumber " _
& " FROM tblLot INNER JOIN tblMarker " _
& " ON tblLot.LotID = tblMarker.mLotID " _
& " WHERE (((tblLot.LotNumber)= " & Me.LotNumberTested & "));"

DoCmd.OpenForm "frmTest Results", acNormal, strSql

Then in the Form_Open event for frmTest Results, I set focus to a specific control.

The form opens, displays the correct information but the cursor does not show up. The form, although open and on top of Form1, apparently does not have focus. If I click anywhere on the new form, the proper control then shows it has focus.

I have also tried to force the form to have focus by using Me.SetFocus as well as making Form1 not visible thinking it was somehow retaining its focus.

Why does the new form not have focus? What am I missing?

Thanks for any advice!
 

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

Top