Created
March 13, 2015 17:15
-
-
Save kissmygritts/24d94d646f13fe5766a8 to your computer and use it in GitHub Desktop.
Loop through recordset and fill form fields.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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