I am having trouble in forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an employees database that I need help with. When I open the form it
sorts by employee number which is the primary key. I want it to sort by last
name, first name. Also, when I input employees in, I want it to automatically
start with last name, first name. Can anyone help??
 
Julie,
You've probably based your form (RecordSource) on a Table. Use a query instead.
Populate the query with all your table fields, and set the query sorting to LastName
Ascending and FirstName Ascending.
As far as entering LastName first and FirstName next, that's a function of the Tab
Order on the form. LastName should have a tab order of 0 and FirstName should be 1... the
other fields 2, ,3 , 4 as desired.

Be aware, that when you after you add the record, and the record is updated, that
record will sort into the recordset by Last/First. It may look like it disappeared, but
it's just moved to it's proper sorting position in the recordset.
 
Make a query based on the table. In query design view, choose Ascending in
the Sort row under the LastName and FirstName fields. Use that query as the
form's record source.
For the second part of your question, what do you mean by "I want it to
automatically start with last name, first name"?
 
Open the form in Design view, look at the properties of the form. On
the Data tab, put LastName, FirstName in the Order by field. On the On
Open event, put Me.OrderByOn = True.

If the form is based on a query, you could also set the sorting in the
query.
 
Back
Top