i have a 2 textbox and 1 listbox. i'm using vb6.

how can i populate the listbox based on the given below?

begindate.text = "05/02/06" 'begindate.text + 7
noofinstallment.text = 25

this should be the output in listbox control.

5/2/06
5/9/06
5/16/06
5/23/06
5/30/06
6/6/06
6/13/06
6/20/06
6/27/06
7/4/06
7/11/06
7/18/06
7/25/06
8/1/06
8/8/06
8/15/06
8/22/06
8/29/06
9/5/06
9/12/06
9/19/06
9/26/06
10/3/06
10/10/06
10/17/06

thanks in advance...

Dim i As Integer
    Dim myDate As String
    
    List1.Clear
    List1.AddItem Text1.Text
    For i = 1 To Val(Text2.Text)

        myDate = DateAdd("d", 7 * i, Text1.Text)

        List1.AddItem myDate

    Next i

This is one way, im sure there is another. This also needs some checks at the start to make sure the entered date is valid etc (try isDate)


pG

thanks for help... purplegerbil just exactly wath i want....
more power....

GOD SPEED....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.