Start New Discussion within our Software Development Community

I need some help with the following.

I have a form called frmMain that has a couple of icons, one of the icons when clicked loads frmNotes within a Panel, frmNotes has a ListView and i want to load data from a Microsoft Access Database Table into the ListView

I've tried with the following code however it is not working:

Imports System.Data.OleDb
Public Class frmNotes
    Public Populate As PsychologicalStateTrackerDataSet

    Private Sub frmNotes_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize

    End Sub

    Private Sub frmNotes_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PsychologicalStateTrackerDataSet.tblNotes' table. You can move, or remove it, as needed.

        For Each Note In PsychologicalStateTrackerDataSet.tblNotes

            Dim Populate As New ListViewItem

            Populate = ListViewSearch.Items.Add(Note.fldDate)



    End Sub

End Class

Have you set up the TblNotesTableAdapter with the necessary Access SQL command and connection

I would run in debug but before you go into the For each Note loop I'd check that PsychologicalStateTrackerDataSet.tblNotes.Rows.Count > 0 i.e. you have data.

Also what have you defined Note as? Looking at the code it should be a datarow but it looks like you have it as a class of some sort.

This question has already been answered. Start a new discussion instead.