Skip to content

Instantly share code, notes, and snippets.

@kissmygritts
Created March 13, 2015 17:15
Show Gist options
  • Save kissmygritts/24d94d646f13fe5766a8 to your computer and use it in GitHub Desktop.
Save kissmygritts/24d94d646f13fe5766a8 to your computer and use it in GitHub Desktop.
Loop through recordset and fill form fields.
Sub Loop_RS()
Dim siteSQL as String
Dim siteRS As DAO.Recordset
siteSQL = "SELECT * FROM Site WHERE Site.Site_ID = " & Me.Site_ID & ";"
Set siteRS = CurrentDb.OpenRecordset(siteSQL, dbOpenDynaset)
For Each fld in siteRS.Fields
fld.Value = Me.Controls(fld.Name).Value
Next fld
siteRS.Update
siteRS.Clsoe
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment