代码应该设置在窗口的AfterLoad事件中,而且要改为:
If _UserName = "甲" Then Forms("销售管理窗口").Controls("Button3").Visible = False Else Forms("销售管理窗口").Controls("Button3").Visible = TrueEnd If
理由你看看这一节最后面的总结:
http://www.foxtable.com/help/topics/2048.htm