Private Sub 专柜_AfterUpdate()
Dim myctr As Control '定义变量
For Each myctr In Me.销售查询新.Form '在销售查询窗体中循环
If IsNull(Me.专柜) = False Then '如果用户输入了专柜,则隐藏其他的字段
If Left(myctr.Name, 3) = Me.专柜 Or myctr.Name = "销售ID" Or myctr.Name = "货品代码" Or myctr.Name = "品牌" Or myctr.Name = "类别" Or myctr.Name = "系列" Or myctr.Name = "单价" Then
Me.销售查询新.Form(myctr.Name).ColumnHidden = False
Else
Me.销售查询新.Form(myctr.Name).ColumnHidden = True
End If
Else '如果用户没有选择专柜,则显示全部字段
Me.销售查询新.Form(myctr.Name).ColumnHidden = False
End If
Next myctr
能帮忙瞧瞧吗!!!最好有实例!!!!我这是从贵网来的!原来就没附件!![em04][em04][em04]
[此贴子已经被作者于2006-5-20 14:25:52编辑过]
|