Results 1 to 4 of 4

Thread: Filtering results from a table

  1. #1

    Thread Starter
    Member Rocky_Lad's Avatar
    Join Date
    Jan 2005
    Posts
    57

    Filtering results from a table

    Hey,

    Have a slight problem, im trying to filter things from a table to be put onto a report. I can't think of a way to do it, ive looked around and cant see anything..

    any ideas?

    Thanks


    I reject your reality and substitute my own.

  2. #2
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: Filtering results from a table

    is this Access?

    if so, create a query that does all of the filtering for you, and base your report on that.

    or if you want to base your report on the table you can use the filter criteria of the openReport method:
    VB Code:
    1. DoCmd.OpenReport "MyReport",acviewPreview,,"[Filter Field] = 'Filter Criteria'"

    HTH
    if you fail to plan, you plan to fail

  3. #3

    Thread Starter
    Member Rocky_Lad's Avatar
    Join Date
    Jan 2005
    Posts
    57

    Re: Filtering results from a table

    Itn is access

    this is a restaurant ordering system, and the orders are linked by table numbers. I am trying to bring up all entries from said table that have the same table number, selecting the number from a combo box. I couldnt figure out how to do this with a query.


    I reject your reality and substitute my own.

  4. #4
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: Filtering results from a table

    yeh, wouldnt bother with the query.

    use this for the After Update of hte combo box:
    VB Code:
    1. Private Sub cboMyCombo_AfterUpdate()
    2.  
    3. DoCmd.OpenReport "Report Name",acViewPreview,,"[Table Number]=Forms!frmMyForm!cboMyCombo"
    4.  
    5. end sub
    this opens a report called 'Report Name' in preview mode , where the field 'Table Number' equals the value in the combo box cboMyCombo
    if you fail to plan, you plan to fail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width