Forms and form buttons

T

TaylorLeigh

I have 2 questions both for the same form.

1. I have an order from with an order entry subform. On the form I also
have an "add new entry" button. When I select the button, I get a new form.
How do I get it to go the the first line of entry automatially without having
to select the first line of entry manually?

Also, first time through all is good. Second and subsequent times, the
"one" side of the form works correctly, but the subform jumps to the
"extended price" section. The tab stops are 1. Product 2. Price 3.
Quantity 4. Extended price

Thanks,
 
L

Linq Adams via AccessMonster.com

When moving from record to record on any form, Access gives focus to the
field that held focus on the previous record. In other words, if the last
field on your subform that had focus was "Extended Price" then you move back
to the main form, then back to the subform again, or simply move from one
record on the subform to another on the subform, "Extended Price" is where
the focus will be.

Open the form your subform is based on, independently (by clicking its name
in the form tab of the Objects box) in Design View, and place this code in
the form's code module:

Private Sub Form_Current()
Product.SetFocus
End Sub

assuming you want the "Product" field to have focus when a new record is
created. If the actual name of the textbox is something other than "Product"
substitute that name in the code.
 
T

TaylorLeigh

I put in the code, went into the code for the subform and can see what I have
entered and it looks good, but it still does not work for me.
 

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