Subform New Record

G

Guest

There are two questions that I have....

On a subform (datasheet view)....is there a way to force the blank *New
Record line to always appear at the top instead of at the bottom of the
subform. Basically to reverse the order the rows appear?

If not, can I add a button to my main form tied to "New Record" on my
subform. My subform is named "RebSub" if you could give me some sample code

Thank you
 
S

Someone

Bryan

Change the form's recordsource from being the table to a query of the table.
This way, you can sort by any field, or combination of fields, that you
wish.

M
 
G

Guest

You can't get the new record row to the top of the subform, but you can move
to a new record on it with the following code in the Click event procedure of
a button on the parent form:

Me.RedSub.SetFocus
DoCmd.GoToRecord, Record:=acNewRec

Or you could out it in the parent form's Current event procedure so that it
moves there automatically when you navigate to a record in the parent form.

One caveat here; RedSub must be the name of the subform control on the
parent form, i.e. the control which houses the subform, nit the name of its
underlying form object. Unless both have the same name of course, which is
allowable, though probably not advisable.

Ken Sheridan
Stafford, England
 

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