Results 1 to 12 of 12
  1. #1
    karanvemuri is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    56

    Search form with Two parameters

    i ned to create a search form with two parameters agent name and Date. The search criteria will be given on the two text boxes in the search from one for date and one for agent, and the results should be displayed in a list box below... any ideas are greatly appreciated.

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529

  3. #3
    karanvemuri is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    56
    thts exactly wat i was lookin for, thanks Alan, had another query though

    I need to create a report based on a query where report shows the Agent name, total no of orders that he worked on today, with total no of orders the agent closed today itself i.e as per field 'closed' any ideas where to start.

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Create an aggregate query using the fields for Agent, Orders Worked and Orders Closed. Group on the Agent and sum on the other two fields. To make a query aggregate, click on the Greek Sigma

    Alan

  5. #5
    karanvemuri is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    56
    HI Alan, i have no fields for orders closed and orders worked. I have a form where agent enters the order number everyday and he leaves the status field as Open or Closed. so basicaly i ned a report where it shows the agent name, total no of orders worked by the agent for today which will be including both Open and closed status. and also the total no of orders which are in "closed "state for today

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Ok. A couple of ways to solve this. In your query, change to an aggregatge and sum on the Status field grouping on the person and date. This will give you the total orders by date by person.

    In a new query, do the same as above but in the criteria for status, put "closed." This will give you the number of orders closed by person by date.


    Alan

  7. #7
    karanvemuri is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    56
    Ok. A couple of ways to solve this. In your query, change to an aggregatge and sum on the Status field grouping on the person and date. This will give you the total orders by date by person.
    Alan not able to get the quote highlighted in red, can you elaborate a little? thanks again

  8. #8
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    With your query open in design view, click on the Greek Sigma (Looks like a Captial E). In the status field, change the term group on to Sum. Run your query with only three fields, Status, Person and Date.

    Alan

  9. #9
    karanvemuri is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    56
    Can i create a report where i will be able to show both the Query results Alan?

  10. #10
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I'm thinking that you can. Have you tried making one report from the query and then creating a subreport from the second query. I don't do much with reports. You may want to start a new thread (as it is a slightly different subject)and post it so that you get as many eyes as possible on it. I may not be your best resource for reports as I don't use them often.

    http://www.databasedev.co.uk/access2007_subreports.html

    Alan

  11. #11
    karanvemuri is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    56
    HI Alan,thanks for the link, having a problem with the querys now though. Whenever i run the querys...m having an error stating Datatype mismatch in criteria Expression.???

  12. #12
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    This means that where you are trying to link two or more tables the data types are mismatched. Look over your relationships and make sure that the data types are the same. Cannot link a text data type to a number data type, etc.

    Alan

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form to supply parameters to a report
    By Ray67 in forum Reports
    Replies: 11
    Last Post: 07-22-2011, 02:06 PM
  2. form and field name as sub-routine parameters
    By eric.opperman1@gmail.com in forum Programming
    Replies: 5
    Last Post: 04-18-2011, 08:51 AM
  3. Passing parameters from a form
    By rfs in forum Forms
    Replies: 1
    Last Post: 03-15-2011, 12:25 AM
  4. Custom Form to Collect Query Parameters
    By andersonEE in forum Forms
    Replies: 5
    Last Post: 03-14-2011, 02:17 PM
  5. Form to enter all parameters in a macro
    By jackthedog in forum Access
    Replies: 0
    Last Post: 05-05-2009, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums