Hi,
I am trying to load a number of records into a subform "Schedule Codes" from form "Certif" using the followowing code.
Do While Not RS.EOF
With RS
Forms![certif]![schedule codes]![GroupNo] = !GroupNo
Forms![certif]![schedule codes]!
I am trying to load a number of records into a subform "Schedule Codes" from form "Certif" using the followowing code.
Do While Not RS.EOF
With RS
Forms![certif]![schedule codes]![GroupNo] = !GroupNo
Forms![certif]![schedule codes]!
Code:
= !Code
Forms![certif]![schedule codes]![Date] = Now()
Forms![certif]![schedule codes]![GroupNo].SetFocus
DoCmd.GoToRecord , , acNewRec
RS.MoveNext
End With
Loop
RS.Close
Forms![certif].SetFocus
The load works OK execpt that data is only loaded into the first record of the subform and I get a "Can't go to Specified Record" error when the "DoCmd.GoToRecord , , acNewRec" command is executed. I tried to use SetFocus to the subform but get the error "Can't move to the control Schedule Codes". The .SetFocus only seems to work if I enter a field name.
Any help on loadiing data into a subform would be appreciated.