Sorting command in VBA code?

  • Thread starter Thread starter mattmanp
  • Start date Start date
M

mattmanp

Hey, I am new here and new to Access. I was asked to try to updat
some features in something that someone else created (he is no longe
around), and I had run into a couple roadblocks. So, I was hoping yo
guys could help

1) I want to be able to sort depending on the users choice (buttons)
Is there a command similar to DoCmd.ApplyFilter that will allow me t
sort

2) I want to be able to look at either a certain client (ClientName)
within a date range (ScannedDate), or both. I have the textboxes se
up and it works for client, how can I add a date range to this

That is all for now, thanks for the advice. I searched through the ol
posts and didn't find much that seemed to jump out at me as what
needed

Mat
 
Answers in line:

1) I want to be able to sort depending on the users choice (buttons).
Is there a command similar to DoCmd.ApplyFilter that will allow me to
sort?

Build a query using the commands from:

Records ... Filter ... Advanced Filter Sort

from the menu to get you there. Or you can use Filter By Form.
2) I want to be able to look at either a certain client (ClientName),
within a date range (ScannedDate), or both. I have the textboxes set
up and it works for client, how can I add a date range to this?

You can use a dialog form or enter the parameters directly in a query:

SELECT Table1.*
FROM Table1
WHERE (((Table1.DateField) Between [Enter the Starting Date] And [Enter the
Ending Date]) AND ((Table1.ClientName)=[Enter a Client Name]));

You will be prompted for the parameters
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top