by yunus saiyad (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 20th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Subroutine to display a recordset on a form.
Public Sub BIND(frm As Object, r As Recordset)
Dim CTL As Control
Dim i As Integer
For i = 0 To r.Fields.count
For Each CTL In frm.Controls
If TypeOf CTL Is TextBox Or TypeOf CTL Is OptionButton Then
If (CTL.Tag) = i Then
Set CTL.DataSource = r
CTL.DataField = r.Fields(i).Name
End If
End If
Next CTL
Next i
End Sub