Set the image boxes datasource and datafield to the datacontrol your using in vb!
Be back to give example! soon
Printable View
Set the image boxes datasource and datafield to the datacontrol your using in vb!
Be back to give example! soon
OK Example:
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Data Source= DATABASE NAME HERE"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "TABLE NAME HERE", cn, adOpenKeyset, adLockPessimistic, adCmdTable
PopulateFields
end sub
Public Sub PopulateFields()
If Not (rs.BOF And rs.EOF) Then
txtDescription.Text = rs.Fields("Description")
Set Image1.DataSource = rs
Image1.DataField = "Picture"
End If
End Sub
hope it helps!
I get this error message:
Unable to bind to field or datamember: 'FIELD NAME'
what's lacking?
Thanks dude!
In this:
Public Sub PopulateFields()
If Not (rs.BOF And rs.EOF) Then
txtDescription.Text = rs.Fields("DB FIELD NAME") 'this is not needed i have it in mine for a description of the pic!
Set Image1.DataSource = rs
Image1.DataField = "DB OLE FIELD NAME"
End If
End Sub
Let me know!