Results 1 to 6 of 6

Thread: Simple coding(solved)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    Resolved 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.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Simple coding

    I hope this 'cleaner' code would work...
    VB Code:
    1. Dim today As String
    2. today = Format$(Date, "dd/mm/yyyy")
    3. With rs
    4.     .Open "Select * from tblDate where F_upDate >= '" & today & "' order by F_upDate desc", con, adOpenKeyset, adLockPessimistic
    5.     While Not .EOF
    6.         MSFlexGrid1.AddItem !EnqNo & Chr(9) & !F_upDate & Chr(9) & !FirstName ................
    7.         .MoveNext
    8.     Loop
    9. End With
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    Re: Simple coding

    is not work. still getting only 1 record. Please help!

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Simple coding

    Try this...


    Dim todayAs String
    today = 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

    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    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
  •  



Click Here to Expand Forum to Full Width