Sorting

B

BNicole

I have created a form for customer with a command button that will pull up a
form for each workorder, but I am having a problem where every workorder pops
up (no matter which customers). How can I sort the workorders by customer
where only the workorders for a specific customer pops up???
 
K

KARL DEWEY

Use a form with unbound textbox or listbox to enter customer identification
or select. Have a command button to open second form that uses a quesry with
the select form as criteria for customer.
 
J

John W. Vinson

I have created a form for customer with a command button that will pull up a
form for each workorder, but I am having a problem where every workorder pops
up (no matter which customers). How can I sort the workorders by customer
where only the workorders for a specific customer pops up???

This has nothing to do with "sorting" - that term means "to put a set of
values in a specified sequential order".

You can base your Report, not on the workorder table, but on a Query
referencing a form on your control to pull up reports only for that customer;
something like

=Forms!YourFormName!cboCustomerID

as a criterion on the CustomerID. You'll need to use your own form and control
and fieldnames of course.

Or you can edit the wizard-generated VBA code in the button's Click event to
use a WhereCondition argument - depending on your version, there may be a
default strCriteria variable. If you set it to something like

strCriteria = "[CustomerID] = " & Me!cboCustomerID

it will display the report only for the CustomerID value currently selected in
the combo box named cboCustomerID (again, adjust for your own object names).

John W. Vinson [MVP]
 

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