Hello,
I am trying to make a record counter for a textbox i have on my form. Basically i have an Access database called Member and wish too count how many records there are in the database and insert the figure into the textbox called MemberID. I am doing this to stop duplication in my form. I am doing it on the MemberID which is a Primary Key and not an autonumber.
I have tried this code so far but i have had no luck
I have got alot of code on my database. But i have tried using count so it goes up in order and the user wont have to enter anything into the textbox but i am really struggling to get it working.vb.net Code:
Public Class frmMember Dim Include As Integer Dim Connect As New OleDb.OleDbConnection Dim DataSet As New DataSet Dim DataAdapter As OleDb.OleDbDataAdapter Dim StructuredQueryLanguage As String Dim LastRow As Integer Dim Maxrows As Integer Private Sub btnNewRecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewRecord.Click txtMemberID.Text = DataSet.Tables("Members").Rows.Count 'Maxrows = DataSet.Tables("Members").Rows.Count Include = +1
Any suggestion on fixing my problem would be grateful
Thank You![]()




Reply With Quote