功能没放全,第一个问题是因这窗体名称不对
把宏里的"退房管理"改为"子窗体"
另外建议你不要用宏,直接用VBA代码直观
Private Sub Combo112_AfterUpdate()
With CodeContextObject
Forms!主界面!子窗体.Form.Filter = "[客房编号] Like [Forms]![主界面]![子窗体].[Form].[Combo112]"
Forms!主界面!子窗体.Form.FilterOn = True
.Combo114 = ""
End With
End Sub
Private Sub Combo114_AfterUpdate()
With CodeContextObject
Forms!主界面!子窗体.Form.Filter = "[业主姓名] Like [Forms]![主界面]![子窗体].[Form].[Combo114]"
Forms!主界面!子窗体.Form.FilterOn = True
.Combo112 = ""
End With
End Sub
Private Sub 全部_Click()
DoCmd.ShowAllRecords
Forms!主界面!子窗体.Form!Combo112 = ""
Forms!主界面!子窗体.Form!Combo114 = ""
End Sub