Recordset Filter

radek225

Registered User.
Local time
Yesterday, 16:55
Joined
Apr 4, 2013
Messages
307
I would like to get minimal value from "Ski" column
Need to use recordset instead Dmin function because this value will be changed many times. I work with dao.recordset but I never used recordset filter
so I need to do something like this:
Code:
strSQL = "select tblGoraZleceniaNowaWyceny.id_gora_zlecenia, tblGoraZleceniaNowaWyceny.naklad_pracy, tblGoraZleceniaNowaWyceny.nazwa, tblGoraZleceniaNowaWyceny.Ski, tblMontazSzczegoly.iloscuzytkow from tblGoraZleceniaNowaWyceny inner join tblMontazSzczegoly on tblGoraZleceniaNowaWyceny.id_gora_zlecenia = tblMontazSzczegoly.nazwa where tblGoraZleceniaNowaWyceny.id_wycena_pre=" & Forms!frmWycenyObszarRoboczy!ID_wycena_pre & " order by error desc"

Wor = 5
Get the minimum value from strSQL (Ski column)
update this value = Ski+1
wor = wor-1
and loop all procedure until Wor = 0

So the problem is how to requery strSQL to show NEW minium value at the beginning query - rst.requery doesn't work:/

Above it's only example but If I will know how to write above code, then I will solve my problem (which has more complicated meaning to explain).
 
What is Wor, from where is it coming?
Use the Query wizard to find out how the SQL-string should look like!
 
What is Wor, from where is it coming?
wor is a variable as long
sometimes wor= 5, sometimes could be 23 etc. There's no rule. It comes from another code.
 
Last edited:
wor is a variable as long
sometimes wor= 5, sometimes could be 23 etc. There's no rule. It comes from another code.
Then build a For Next loop with a step of -1, starting for the max value of Wor.
Find the Min value and update the Min value using an update query.

But why doesn't recordset requery not work?
 
Then build a For Next loop with a step of -1, starting for the max value of Wor.
Find the Min value and update the Min value using an update query.

But why doesn't recordset requery not work?

THX for your insight!
The problem was "...desc" istead "....asc" in my query.
 

Users who are viewing this thread

Back
Top Bottom