使用在MS Access中使用多个表的子报表

时间:2017-07-07 09:05:45

标签: ms-access

我创建了一个使用多个表(3个表)的子报表,并更新和删除表中的数据。enter image description here

下面是更新和删除子报表数据的表单。 enter image description here

当我点击“编辑”按钮时,表单上加载的所有数据,但第一个组合框都没有加载数据。见下图![enter image description here] 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

0 个答案:

没有答案