我创建了一个使用多个表(3个表)的子报表,并更新和删除表中的数据。
当我点击“编辑”按钮时,表单上加载的所有数据,但第一个组合框都没有加载数据。见下图] 3
这是我为编辑按钮编写的代码
> Private Sub EditState_Click()
> If Not (Me.subformStateBudget.Form.Recordset.EOF And Me.subformStateBudget.Form.Recordset.BOF) Then
> With Me.subformStateBudget.Form.Recordset
> Me.cbState = .Fields("State")
> Me.cbCategory = .Fields("Category")
> Me.cbYear = .Fields("Year")
> Me.Ctl4 = .Fields("4")
> Me.Ctl5 = .Fields("5")
> Me.Ctl6 = .Fields("6")
> Me.Ctl7 = .Fields("7")
> Me.Ctl8 = .Fields("8")
> Me.Ctl9 = .Fields("9")
> Me.Ctl10 = .Fields("10")
> Me.Ctl11 = .Fields("11")
> Me.Ctl12 = .Fields("12")
> Me.Ctl1 = .Fields("1")
> Me.Ctl2 = .Fields("2")
> Me.Ctl3 = .Fields("3")
>
> Me.cbState.Tag = .Fields("State")
> 'Change caption of Save Button to Update
> Me.savestate.Caption = "Update"
> 'Change Edit Button to hidden
> Me.EditState.Enabled = False
>
>
> End With
> End If End Sub