•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 374,011 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,812 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 451 | Replies: 4
![]() |
•
•
Join Date: Apr 2008
Posts: 12
Reputation:
Rep Power: 1
Solved Threads: 0
Hi All,
Back again looking for some help and guidance, I have a recordset and I want to loop through this recordset until I find the field with the highest date. I am have a basic knowledge of how it should work but I have no idea what way to express the condition that means do until lastdate . I am not to sure how clear I am being but any help would be appreicated as always.
This is all I got so far
Rgds
Nora.
Back again looking for some help and guidance, I have a recordset and I want to loop through this recordset until I find the field with the highest date. I am have a basic knowledge of how it should work but I have no idea what way to express the condition that means do until lastdate . I am not to sure how clear I am being but any help would be appreicated as always.
This is all I got so far
Do While Not rs.EOF And (rs!NEXTDUEDATE > PNUM(2,ctr))
Let PNUM(1, ctr) = rs!LastOfEMPCODE
Let PNUM(2, ctr) = rs!NEXTDUEDATE
Let PNUM(3, ctr) = rs!LASTPERFDATE
Let PNUM(4, ctr) = Eqnum
rs.MoveNext
Let ctr = ctr + 1
LoopRgds
Nora.
Hi,
Try this :
Regards
Veena
Try this :
vb Syntax (Toggle Plain Text)
Do While Not rs.EOF Let PNUM(1, ctr) = rs!LastOfEMPCODE Let PNUM(2, ctr) = rs!NEXTDUEDATE Let PNUM(3, ctr) = rs!LASTPERFDATE Let PNUM(4, ctr) = Eqnum ' rs.MoveNext Let ctr = ctr + 1 If (rs!NEXTDUEDATE > PNUM(2,ctr)) Then Exit Do End If Loop
Regards
Veena
•
•
Join Date: Apr 2008
Posts: 12
Reputation:
Rep Power: 1
Solved Threads: 0
Thanks very much for your help but I have encountered a problem, if there is more than one record it works fine, but on occasion there may be a new item which would only have one record in this instance an error is created. Would it be possible to add a statement that will prevent the error when only one record is encountered.
Tried adding this but it wasn't any good. Again your help is appreciated.
Tried adding this but it wasn't any good. Again your help is appreciated.
Do While Not rs.EOF Let PNUM(1, ctr) = rs!WONUM Let PNUM(2, ctr) = rs!COMPLETIONDATE Let PNUM(3, ctr) = rs!EMPCODE Let PNUM(4, ctr) = Eqnum ' rs.MoveNext Let ctr = ctr + 1 If ctr > 1 Then If (rs!COMPLETIONDATE > PNUM(2, ctr)) Then Exit Do End If End If Loop
Hi,
Try this :
REgards
Veena
Try this :
vb Syntax (Toggle Plain Text)
Do While Not rs.EOF Let PNUM(1, ctr) = rs!WONUM Let PNUM(2, ctr) = rs!COMPLETIONDATE Let PNUM(3, ctr) = rs!EMPCODE Let PNUM(4, ctr) = Eqnum ' rs.MoveNext Let ctr = ctr + 1 If ctr > 1 And Not rs.EOF Then If (rs!COMPLETIONDATE > PNUM(2, ctr)) Then Exit Do End If End If Loop
REgards
Veena
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- ADO Data Control (ADODC) Problems with .recordset.find (Visual Basic 4 / 5 / 6)
- How do I pass data from a recordset on asp page towards an array on js file (JSP)
- problems with recordset accessing access (Visual Basic 4 / 5 / 6)
- In MS Flexgrid how to assign recordset to the fields ? (Visual Basic 4 / 5 / 6)
- recordset from multiple checkbox values (ASP)
- ADODB.Recordset error '800a0bb9' (ASP)
- Execute from Sparc Solaris, retrieve a recordset from VB application running on WIN2K (C++)
- "ADODB Recordset error" (ASP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Reading names of files present in a folder
- Next Thread: loading images from sql server using vb6


Linear Mode