Filtering data For Printing Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yishinstar
    New Member
    • Nov 2013
    • 2

    Filtering data For Printing Report

    Hi my name is ley and i have finishing my ojt project its a record report system my project is in 85% completion and this
    is problem

    I have a 4 combo box for options and 2 text box for dateFROM and dateTO 5 boxes in total to be fill up

    and this is the query i worked up....
    Code:
    Set rs = New ADODB.Recordset
    rs.Open "Select * from tbleout where Recipient like '" & Combo1.Text & "%' OR '" & Combo2.Text & "%' AND DocumentType like '" & Combo3.Text & "%' AND Origin like '" & Combo4.Text & "%' AND Date between #" & Text1.Text & "# AND #" & Text2.Text & "#", cn, adOpenKeyset, adLockOptimistic
    Problem:
    1. my query is running the problem is the output is not match to the filter condition i fill up..Example i want accredition for document type and Maximo for Origin..but the output is he displaying all the accredition document type and disregard the condition of maximo in origin..

    2. i have a problem in this query i made. i need to input a date to the 2 text box if not its displaying an error said " syntax error in date query"

    by the way im using vb6.0 and MS access

    i hope u can help me guys i appreciated it so much tnx in advance
    sorry for my poor english ^^
    Attached Files
    Last edited by Rabbit; Nov 15 '13, 03:58 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • Patrickwwevans
    New Member
    • Nov 2013
    • 8

    #2
    Just curious but is there a reason you did not build a query to resolve this in MS Access? I ask since using the query builder usually gives you a very usable sql statement and you can refer to objects on the form easily by use of criteria builder.

    Comment

    • yishinstar
      New Member
      • Nov 2013
      • 2

      #3
      this is my first time using ms access sorry!!

      Comment

      Working...