orderby sorts on primary Key and not field string

J

jwsigler

I have a problem getting orderby to sort on a column's string text and not
the underlying Primary key. I did the following: 1) Took the standard
Northwinds database and created a form called sortTest using a datasheet form
and the entire Orders Table. 2) after defining an event procedure for a "On
Click" in the Employee column, I tried to execute a Orderby ="EmployeeID".
Even through the column contains strings listing each employee's fullname,
the orderby sorted on the underlying employeeID number instead of the
employee name. The toolbar sort sorts on the employeename, but I can not
figure out how to achieve the same result in a VBA event procedure. Anyone
have any suggests?
 
S

Stefan Hoffmann

hi,
2) after defining an event procedure for a "On
Click" in the Employee column, I tried to execute a Orderby ="EmployeeID".
How did you do that?

Me.OrderBy = "EmployeeID"
Me.OrderByOn = True

will sort by ID not by the name. You have to enter the name of the field
of your column in Me.OrderBy.


mfG
--> stefan <--
 

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