You folks helped me by creating a module to populate something in a table...it works great. Now I've created a button, but I can only get it to open the module, and I need it to run the module. How do I do that?
Here's the code for the module:
Option Explicit
Sub PopulateHeader()
Dim rs As DAO.Recordset, strHeader As String
Set rs = CurrentDb.OpenRecordset("SELECT * FROM Raw_Data WHERE Header Is Null ORDER BY ID;")
While Not rs.EOF
If rs!Field6 = "T0" And strHeader <> Left(rs!Field1, 19) Then
strHeader = Left(rs!Field1, 19)
Else
rs.Edit
rs!Header = strHeader
rs.Update
End If
rs.MoveNext
Wend
End Sub