SBBmaster09
Registered User.
- Local time
- Today, 09:35
- Joined
- Apr 26, 2013
- Messages
- 92
Hi, I have a continuous form. I am able to update the data if the continuous form has only one entry. I successfully use the code below:
My problem is, when my query has multiple data, it only updates the 1st row of the continuous form. How can I update the other next entries?
Existing code below doesn't works.
Code:
Set dbforms = CurrentDb
strSQL = "SELECT * FROM MainData WHERE [Enterprise ID] = '" & Me.txtAttUser.Value & "'"
Set rstforms = dbforms.OpenRecordset(strSQL, dbOpenDynaset)
rstforms.Edit
rstforms("[Employment Status]").Value = Me.txtAttStat.Value
rstforms.Update
rstforms.Close
dbforms.Close
My problem is, when my query has multiple data, it only updates the 1st row of the continuous form. How can I update the other next entries?
Existing code below doesn't works.

Code:
Set dbforms = CurrentDb
strSQL = "SELECT * FROM MainData WHERE [Enterprise ID] = '" & Me.txtAttUser.Value & "'"
Set rstforms = dbforms.OpenRecordset(strSQL, dbOpenDynaset)
cnt = 0
rstforms.MoveFirst
Do Until rstforms.EOF
rstforms.Edit
rstforms("[Employment Status]").Value = Me.txtAttStat.Value
rstforms.Update
cnt = cnt + 1
rstforms.MoveNext
Loop
rstforms.Close
dbforms.Close