Set Focus

T

TaylorLeigh

I am going to try this one more time....

I have had to Tech people looking at this from my end and I can not seem to
get an answer. Someone out there has to be smarter than the three of us!!!
I have a form with a subform. First 4 entries of the form are Date-Invoice
Number-
Division - Name. Then the subform gets focus. I have Product - Quantity -
Price - Extended Total (calculated field). Then the main form comes back
into play with Product Subtotal (Calculated field) - Freight - Sales Tax -
and Total Invoice (Calculated field). This works fine first time through. I
am good second time through until I get to the subform. Then it goes to
Price every time. Between the three of us here, we have tried every
combination of event procedures we can come up with and still the subform
goes to price every time. There are also three control buttons on the form
-- New Record - New Product and Exit. Need an answer even if I have to trick
this thing so it will go to Product on the subform every time I have a new
record. Tearing my hair out!!!!!!!!!!!!!
 
M

Maurice

Maybe On_exit from division name: me.subform!product.setfocus that way you
force it to go to product after the first four have been added...
 
D

Dirk Goldgar

TaylorLeigh said:
I am going to try this one more time....

I have had to Tech people looking at this from my end and I can not seem
to
get an answer. Someone out there has to be smarter than the three of
us!!!
I have a form with a subform. First 4 entries of the form are
Date-Invoice
Number-
Division - Name. Then the subform gets focus. I have Product -
Quantity -
Price - Extended Total (calculated field). Then the main form comes back
into play with Product Subtotal (Calculated field) - Freight - Sales Tax -
and Total Invoice (Calculated field). This works fine first time through.
I
am good second time through until I get to the subform. Then it goes to
Price every time. Between the three of us here, we have tried every
combination of event procedures we can come up with and still the subform
goes to price every time. There are also three control buttons on the
form
-- New Record - New Product and Exit. Need an answer even if I have to
trick
this thing so it will go to Product on the subform every time I have a new
record. Tearing my hair out!!!!!!!!!!!!!


How are tabbing out of the subform? Is there some tricky code that
automatically transfers you back to the main form when you tab out of the
Price field? If so, that could be modified to put the subform's focus back
on the Product field.

However, if you always want to be in the Product field when you go from the
main form to the subform, you could put code in the subform control's Enter
event to do it. For example,

Private Sub YourSubformControl_Enter()

Me.YourSubformControl.Form!Product.SetFocus

End Sub


In the above, "YourSubformControl" should be replaced with the name of the
subform control on your main form; that is, the control that displays the
subform. That name may or may not be the same as the name of the form that
the control displays.
 

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