Gooood morning everyone,

here's another question from me to break your heads at
well I gues it's not so hard.

Here's the situation:

I've got a beautiful SQL query that loads into a grid. That works fine.
But I want to use the same query to use it for another grid on the same form. Only this time it needs a little extra. here's the query:

VB Code:
  1. Dim strSQL As String
  2.  
  3.   Set cn = New ADODB.Connection
  4.   cn.ConnectionString = "Data Source=spijsDB;User ID=spijs;Password=spijs;"
  5.   cn.Open
  6.   Set rs = New ADODB.Recordset
  7.   grdDatagrid2.Refresh
  8.   cn.CursorLocation = adUseServer
  9.   strSQL = "   SELECT  PO.Verstoring, PO.OpdrachtId, PO.Bonnummer, " & _
  10.             "          PO.ReceptId, A.ArtikelNaam, RT.TypeCode, " & _
  11.             "           PO.RetourID, PO.RetourHoeveelheid, " & _
  12.             "           PO.Plandatum, PO.ChargeGewicht, " & _
  13.             "           PO.AantalCharges, PO.AantalGereed, " & _
  14.             "           PO.StartDatumTijd, PO.LotnummerWas, " & _
  15.             "           PO.Bestemming, R.Versie, PO.Status, " & _
  16.             "           PO.Blokkeren, PO.Commentaar, " & _
  17.             "           R.ChargeGewichtKg, R.Datum, PO.ProductCode, " & _
  18.             "           PO.IsOrder, R.NieuwRecept, PO.IsVerwijderd, " & _
  19.             "           PO.OperatorInvoer " & _
  20.             "   From    ReceptType RT, Recepten R, Artikelen A, ProductieOrders PO " & _
  21.             "   WHERE   RT.ReceptTypeId = R.ReceptTypeId (+) and " & _
  22.             "           R.ReceptId = PO.ReceptId (+) and " & _
  23.             "           PO.ReceptId = A.ArtikelId and " & _
  24.             "           PO.IsVerwijderd = 0 " & _
  25.             "           PO.isorder = 1 " & _
  26.             "  ORDER BY PO.Verstoring, PO.OpdrachtId "
  27.   rs.Open strSQL, cn

And with the second grid it needs PO.isorder = 0 instead of = 1

Anyone has a solution for this? Or do I just have to make a new query?