open a form and sorted by employee ID

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

I am using access 97. I set two forms. One is a "search
form" which the user select all criteria and the second
one is a "result form" based on a query and the criteria
selected on the "search form". One of the option is how
to sort the data in the "result form". I am using a VB to
open the "result form" but have a problem to write the
sort function in the procedure. I am just a beginning
user. I checked the help function to find something
called OrderBy property but could not get the syntax
correct. Could anyone help? Thank you.
 
I'm not exactly sure what you want but I imagine that if
you were to look at it in terms of a qwery the SQL
statement would look something like this

SELECT TableName.FieldName1, TableName.FieldName2,
TableName.FieldName3 FROM TableName ORDER BY
TableName.FeildName1;

WHERE (((TableName.FieldName)=[Forms]![FormName]!
[ControlName]) AND ((TableName.FieldName)=[Forms]!
[FormName]![ControlName]));

That is where FieldName1 is somthing like Date or Last
name that you want to order by
I hope this is some help
 
Do Not use "Date" as the name of a field! "Date" is a reserved word and sooner
or later you will have problems if you use it as a field name.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


Nathan said:
I'm not exactly sure what you want but I imagine that if
you were to look at it in terms of a qwery the SQL
statement would look something like this

SELECT TableName.FieldName1, TableName.FieldName2,
TableName.FieldName3 FROM TableName ORDER BY
TableName.FeildName1;

WHERE (((TableName.FieldName)=[Forms]![FormName]!
[ControlName]) AND ((TableName.FieldName)=[Forms]!
[FormName]![ControlName]));

That is where FieldName1 is somthing like Date or Last
name that you want to order by
I hope this is some help
-----Original Message-----
I am using access 97. I set two forms. One is a "search
form" which the user select all criteria and the second
one is a "result form" based on a query and the criteria
selected on the "search form". One of the option is how
to sort the data in the "result form". I am using a VB to
open the "result form" but have a problem to write the
sort function in the procedure. I am just a beginning
user. I checked the help function to find something
called OrderBy property but could not get the syntax
correct. Could anyone help? Thank you.
.
 
Back
Top