I'm doing a visual basic 2005 form and binding it to an Access database. The database has a field for pictures in it. The pictures that are already loaded into the database show up fine in the VB form. But when I go to add a new row to the database it doesn't accept the picture into it, but only shows it in the form. Can someone tell me where I'm going wrong. Thanks for any help.
*** I guess this is what I'm really trying to do with the below code... Save Bitmap File as OLE Object in Access OLE Object Field
Private Sub xAddNewButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xAddNewButton.Click 'Adds a new record to the database Const EnterMsg As String = "Please enter a name: " Dim Name As String Name = Me.xNameTextBox.Text If Name = String.Empty Then MessageBox.Show(EnterMsg, "Pix", MessageBoxButtons.OK, MessageBoxIcon.Information) Else Me.PicturesBindingSource1.AddNew() 'Opens dialog to browse for picture If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then Me.xMyPictureBox.Load(OpenFileDialog1.FileName) End If End If Me.xLookupBox.Focus() End Sub
This post has been edited by HellsBelle: 30 April 2008 - 09:08 PM