I have the below excel spreadsheet, looks something like this
ID LAST_NAME FIRST_NAME
1 Smith James
2 Smith James
3 Jackson Jack
4 Jackson Todd
5 Jackson Jack
6 Jackson Jack
7 Rover Robert
I made a vba form where I want to display something like this, each name once with the number of times it is in the table
Smith James 2
Jackson Jack 3
Jackson Todd 1
Rover Robert 1
So far below is the code I have, but it only displays one field and I don’t know how to display the number of times in the data without display the names multiple times. Does anyone know?
Code:
Dim rst As dao.Recordset
Dim sSQL As String
Set rst = CurrentDb.OpenRecordset("SELECT * FROM Reminder")
While Not rst.EOF
Me.txtLastName = rst![LAST_NAME]
Me.txtFirstNAme = rst![FIRST_NAME]
Me.txtNumberP = ""
rst.MoveNext
Wend
rst.Close
Set rst = Nothing