'建立表存放显示名
'表名:xianshiming
'字段:ID, CH,PT,EN,Duixiangming
'ID 主键 自动编号 CH 中文 EN 英文 PT 葡问,Duixiangming控件名
'在窗体的打开事件中加入
Dim NameUser As String
Dim stYuyan As Variant
NameUser = Forms![frmYonghuXinxi].[txtYonghuMingchen] 'frmYonghuXinxi是一个打开的不可见的有用户分组号的窗体
Dim X As String
X = Forms![frmYonghuXinxi]![txtFenzuDaihao] '获取用户分组号
If X < 10 Then
stYuyan = "[ch]"
Me.MenuBar = "chMymenu"
End If
If X > 10 and x <20Then
Me.MenuBar = "ptMymenu"
stYuyan = "[pt]"
End If
If X > 20 Then
Me.MenuBar = "enMymenu"
stYuyan = "[EN]"
End If
Me.cmdXunjiadan.Caption = DLookup(stYuyan, "xianshiming", "ID=2")' 2是控件名cmdXunjiadan对应的号
Me.Form.Caption = DLookup(stYuyan, "xianshiming", "ID=3") '2是控件Form对应的号
Me.lblKehuXinxi.Caption = DLookup(stYuyan, "xianshiming", "ID=4") '2是控件名lblKehuXinxi对应的号