A1VBCode Forums

load array database


http://a1vbcode.com/vbforums/Topic32328.aspx

By jon doe - 8/30/2015

Dear all,



I have a problem with my code, I try load array database, i use textbox for load array database, the code is :



Option Explicit

Dim lngoriginaltop As Long

Dim incremen As Long

Dim index, jmlh As Integer



Private Sub Command1_Click()

index = Text1.Count

Load Text1(index + 1)

Text1(index + 1).Top = Text1(index).Top + 555

Text1(index + 1).Visible = True

Frame1.Height = Frame1.Height + Text1(index).Height

End Sub



Private Sub Form_Load()

lngoriginaltop = Frame1.Top

incremen = (Frame1.Height - Form2.Height) / VScroll1.Max

Read

End Sub



Private Sub VScroll1_Change()

Frame1.Top = lngoriginaltop - (VScroll1.Value * 100)

End Sub



Sub Read()



Kata = "Select * from T_CG"

Set Tfind = New ADODB.Recordset

Tfind.Open word, TMedis, adOpenDynamic



If Not Tfind.EOF Then

Tfind.MoveFirst

While Not Tfind.EOF

index = Text1.Count

Load Text1(index + 1)

Text1(index + 1).Top = Text1(index).Top + 555

Text1(index + 1).Visible = True

Text1(index + 1).Text = Tfind![Name]

Tfind.MoveNext

Wend

End If

Tfind.Close



End Sub



Sub delete()



index = Text1.Count

If Text1(index) <> Text1(1) Then

Unload Text1(index)

End If

Next i

End Sub



my question if I want to add command button besides text.text and the command same like text array, thanks for helping me