Getting the next record (VBA)

R

Rodolfo Fontes

Hi group,

How can I get the next value of a querie?
For example, I can use "temp = rs_NFS!DT_Emissao" to get the DT_Emissao from
the current record, but i want just to get the next value, not "walk" on it.
Below an example:

Dim db_NFS As Database, rs_NFS As Recordset
Set db_NFS = CurrentDb
Set rs_NFS = dbs_produto_OpenRecordset("SELECT [T NF_S].DT_Emissao, [T
NF_S_Det].CodProd, [T NF_S_Det].Qtd_NF, [T NF_S_Det].Valor_NF " _
& " FROM [T NF_S] INNER JOIN [T NF_S_Det] ON [T NF_S].Cod_NF_S = [T
NF_S_Det].Cod_NF_S " _
& " WHERE ((([T NF_S].DT_Emissao) Is Not Null) And (([T
NF_S].Processada) = -1) And (([T NF_S].Cancelada) = 0)) " _
& " ORDER BY [T NF_S].DT_Emissao, [T NF_S_Det].CodProd;")

Thanks,
Rodolfo Fontes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

group by date 0
Random Top 10 percent of groups 6
Sintax error 1
vba Function code 1
Automatically add new record 0
Repost - Automatically add new records 0
query results in Access 3
Help with query 5

Top