|
-
Apr 12th, 2005, 04:24 AM
#1
Thread Starter
Lively Member
Simple coding(solved)
hi,
i want to display all the F_upDate which is greater or equal to today's date in the MSFlexGrid. Here is my coding, its only display one record only. Can someone help to modify it.
Dim today As String
today = Format$(Date, "dd/mm/yyyy")
With rs
.Open "Select * from tblDate where F_upDate >= '" & today & "' order by F_upDate desc", con, adOpenKeyset, adLockPessimistic
While Not rs.EOF()
MSFlexGrid1.AddItem rs!EnqNo & Chr(9) & rs!F_upDate & Chr(9) & rs!FirstName ................
rs.MoveNext
Wend
thanks
Last edited by vivian2u; Apr 12th, 2005 at 10:16 PM.
-
Apr 12th, 2005, 04:40 AM
#2
Re: Simple coding
I hope this 'cleaner' code would work...
VB Code:
Dim today As String
today = Format$(Date, "dd/mm/yyyy")
With rs
.Open "Select * from tblDate where F_upDate >= '" & today & "' order by F_upDate desc", con, adOpenKeyset, adLockPessimistic
While Not .EOF
MSFlexGrid1.AddItem !EnqNo & Chr(9) & !F_upDate & Chr(9) & !FirstName ................
.MoveNext
Loop
End With
-
Apr 12th, 2005, 11:00 AM
#3
Thread Starter
Lively Member
Re: Simple coding
is not work. still getting only 1 record. Please help!
-
Apr 12th, 2005, 07:32 PM
#4
Re: Simple coding
Try this...
Dim todayAs Stringtoday = Format$(Date, "dd/mm/yyyy")
With rs
.Open "Select * from tblDate where DateValue(F_upDate) >= '" & DateValue(today) & "' order by F_upDate desc", con, adOpenKeyset, adLockPessimistic
While Not .EOF
MSFlexGrid1.AddItem !EnqNo & Chr(9) & !F_upDate & Chr(9) & !FirstName ................
.MoveNext
Loop
End With
-
Apr 12th, 2005, 10:04 PM
#5
Thread Starter
Lively Member
Re: Simple coding
still getting only one record. How I can solved this out??
i want to display all the F_upDate which is greater or equal to today's date in the MSFlexGrid. Please help.
-
Apr 12th, 2005, 10:15 PM
#6
Thread Starter
Lively Member
Re: Simple coding
Thanks to Dee-u,
problem solved !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|