Your code should execute if your change
myCommand = New OleDbCommand("SELECT * FROM tbleMember WHERE FormNo='" & cmbName.SelectedValue.toString & "'", MyConn)
to
myCommand = New OleDbCommand("SELECT * FROM tbleMember WHERE FormNo=" & cmbName.SelectedValue.toString , MyConn)
Unless you intend to extract more values than are shown in the SelectedIndexChanged handler, I would suggest that you rethink this code a bit. There is no need for this additional query as you have the valu you are trying to retrieve.
Also, I would also suggest that you change:
Dim asql As String = ("SELECT LastName +', '+ FirstName +' '+ MiddleName AS FullName,FormNo FROM tbleMember")
to
Dim asql As String = ("SELECT LastName +', '+ FirstName + IIF(MiddleName is Null,'',' ' + MiddleName) AS FullName,FormNo FROM tbleMember")
This will prevent a blank entry in the combobox if there is no MiddleName.
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13
Well after realizing that I was using files with Timestamps a day ahead of me, I was able to look at your code and made the changes that we had recommended. It works fine now. I also made a few minor changes to assist you.
Modified project
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13