前两天下载了红尘版主的通用界面,真的很强大,在此先谢谢版主!!
可是当我在做通用子窗体菜单时,系统报错:数据库成员未找到。已解决:应该是 me.frm子窗体名.form.allowadditions = true
代码如下(红色字为报错位置):
Private Sub Form_Load()
'创建窗体菜单
With Me.fsubHeader.Form
.AddMenu "添加(&A)", 1
.AddMenu "删除(&D)", 2
.AddMenu "修改(&E)", 3
.AddMenu "关闭(&C)", 4
End With
End Sub
-------------------------------------------------------------------------------------------------------------------
Public Sub Form_MenuClick(MenuCaption As String)
Dim lngSelected As Long '被选中的菜单项Id
Dim strSQL As String
Select Case MenuCaption
Case "添加(&A)"
me.frm子窗体名.allowadditions = true
Case "删除(&D)"
Case "修改(&E)"
Case "关闭(&C)"
CloseForm Me.Name
End Select
End Sub
--------------------------------------------------------------------------------------------------------------------
请问是什么原因呢?
我想要的效果是:当窗体打开时,子窗体不允许编辑、修改或删除,当按下添加按钮时,子窗体-新记录。
麻烦各位帮看一下问题出在哪里,谢谢!