I am looking to create a query in SQL vba that queries a table, grabs the unique values in a particular field.
On each iteration through the query I want to create a new record for each unique value found...wondering how to do this...I am starting with this
Dim db As Database
Dim Lrs As DAO.Recordset
Dim LSQL As String
'Open connection to current Access database
Set db = CurrentDb()
'Create SQL statement to retrieve value from GST table
LSQL = "SELECT DISTINCT LessonName FROM tbl_V4_Lessons;"
Set Lrs = db.OpenRecordset(LSQL)
Do While not EOF
' Grab the first unique value
' Msgbox that value
Next