|
Dim yr As Currency '余额
Dim jls As Integer '记录数
jls = Me.mscx_1.Form.RecordsetClone.RecordCount - 1
Forms!mscx!mscx_1!余额.SetFocus'焦点移动到子窗体的余额字段
DoCmd.GoToRecord acActiveDataObject, , acFirst
If IsNull(Forms!mscx!mscx_1!余额) Then Forms!mscx!mscx_1!余额 = Nz(Forms!mscx!mscx_1!本期借方, 0) - Nz(Forms!mscx!mscx_1!本期贷方, 0)
Do Until Me.mscx_1.Form.CurrentRecord = jls
yr = Forms!mscx!mscx_1!余额
DoCmd.GoToRecord acActiveDataObject, , acNext
Forms!mscx!mscx_1!余额 = Nz(Forms!mscx!mscx_1!本期借方, 0) - Nz(Forms!mscx!mscx_1!本期贷方, 0) + yr
Loop
运行到"DoCmd.GoToRecord acActiveDataObject, , acNext"时,显示“不能移动到指定记录。这句代码应该怎么写呢?
|
|