dim db as database
dim rs as recordset
db =currentdb
Set RS = Me!frmSetIDsub.Form.Record
RS.MoveFirst
do until rs.eof
rs!OperatorRef=me!memRef
rs.movenext
loop
Main Topics
Browse All TopicsI have a form called 'frmSetID' with a datasheet subform called 'frmSetIDsub'
When I click a command button in 'frmSetID', I would like all the records in 'frmSetIDsub.OperatorRef' number field to equal the number value in 'frmSetID.memRef'
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can check what I posted here maybe:
http://www.experts-exchang
I'm sorry but I'm not sure what you're referring to. Here's the entire piece of code that I'm using.
Private Sub Command4_Click()
Dim db As database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = Me!frmSetIDsub.Form.Record
rs.MoveFirst
Do Until rs.EOF
rs!OperatorIDRef = Me!memRef
rs.MoveNext
Loop
Me!frmSetIDsub.Form.Requer
End Sub
In your loop, you are modifying the recordset, you need to update it.
Private Sub Command4_Click()
Dim db As database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = Me!frmSetIDsub.Form.Record
rs.MoveFirst
Do Until rs.EOF
rs!OperatorIDRef = Me!memRef
rs.update
rs.MoveNext
Loop
Me!frmSetIDsub.Form.Requer
End Sub
Actually, a recordsetclone is "...read-only in all views...".
http://msdn.microsoft.com/
RecordsetClone it better way to update subform from form to avoid write conflict error,and I forgot to put
rs.edit
rs!OperatorIDRef = Me!memRef
rs.update
Code will look this way
Private Sub Command4_Click()
Dim db As database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = Me!frmSetIDsub.Form.Record
rs.MoveFirst
Do Until rs.EOF
rs.edit
rs!OperatorIDRef = Me!memRef
rs.update
rs.MoveNext
Loop
Me!frmSetIDsub.Form.Requer
End Sub
Business Accounts
Answer for Membership
by: dmitryz6Posted on 2005-09-28 at 14:22:07ID: 14979286
dim db as database setClone
dim rs as recordset
db =currentdb
Set RS = Me!frmSetIDsub.Form.Record
RS.MoveFirst
me!memRef =null
do until rs.eof
me!memRef=me!memRef & vbNewLine rs!OperatorRef
rs.movenext
loop