Results 1 to 2 of 2

Thread: Multiple Criteria in Access

  1. #1
    Join Date
    Aug 2002
    Posts
    6,223
    Rep Power
    0

    Default Multiple Criteria in Access

    I have a project opening a report from a selected Access Database. The report uses a query from 'SaleTransactions' that has the following criteria:

    [Start Date]
    [End Date]
    [Supplier_Name]

    At the moment the database launches the report it (the report) asks the user for input for the criteria above. I want the user to use two DTPickers and a text box to select their input and the program to output it to the report.

    So far I have this:

    Code:
    Dim apAccess  As Access.Application
    Set apAccess =  New Access.Application
    
    Dim sCriteria As String
    sCriteria = "myField = 'this criteria'"   'use this to pass a criteria if you need one
    
    apAccess.OpenCurrentDatabase ("t:\data\OchoRiosSales.mdb" )
    apAccess.DoCmd.OpenReport "SaleTransactions", acPreview, , sCriteria
            
    apAccess.Quit
    Set apAccess = Nothing
    However, this assumes I only have one criteria to input. How do I pass multiple criteria input to the database? Or is there a way I can modify the sCriteria string to include multiple criteria?
    .
    PC - Ubuntu 15.04 64bit Desktop
    HP Pav G60-236US 3GB RAM Laptop, Ubuntu 15.04 64bit and Win7 Home

    "So Daddy, how come you telling me stealing not right when YOU copying DVDs? How come? How Come?"


    RIP Ramesh ...

  2. #2
    Join Date
    Dec 2004
    Posts
    159
    Rep Power
    0

    Default

    look at this link
    http://www.access-programmers.co.uk/...ad.php?t=50391

    i hope it helps
    live good today cause u will never know wat will happen 2marrow and it was never promised to no man either

Posting Permissions

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