Private Sub load_image()

  Private Sub load_image()
        Try
            Call connection()

            listselect = LV1.SelectedItems.Item(0).Text

            sql = "SELECT * From tblcustomer WHERE ID ='" & listselect & "'"
            cmd = New OleDbCommand(sql, con)
            dr = cmd.ExecuteReader()

            If dr.Read Then
                pbx1.Image = Image.FromFile("C:\Users\Public\Documents\TPS\Images\" & dr("cstmrpic_name"))
            End If

            Call con.Close()

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

Please post the value of dr("cstmrpic_name"). It would also help to comment out the error handling lines and identify which line is throwing the error.

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.