我需要一个表格来显示某些人的价格并对其他人隐藏,但它是一个列表框
我需要一个可以为某些人显示价格而对其他人隐藏的表单,但它是一个列表框。 我该怎么办? 我发现的唯一解决方案是更改列宽度,但实际上并不是......
I need to have a form that will show prices for some people and hide from others, but it's a listbox.
How do I do?
The only solution I found is to change the cols width, but is not really...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您具有内置安全性,您可以根据 Windows 登录或 Access 登录设置列表框或组合框行源/记录源详细信息。
某种 If 语句与 Login API 结合使用,您可以通过谷歌搜索找到它。一个例子如下(也许在加载事件上执行此操作?) -
Dim UserName As String
UserName = GetUserName_TSB '这是从 LoginAPI 函数提取的 Windows 登录信息
If UserName = "XXXX" Or UserName = "XXXXX"或者 UserName = "XXXXX" 或者 UserName = "XXXX" 然后
Me.combobox.rowsource = '为您的表/数据创建一个 SELECT SQL 查询。
Else
Me.combobox.rowsource = '为其他用户的任何表/数据创建一个 SELECT SQL 查询
End If
You could set the Listbox or combo box rowsource / recordsource details based on Windows login or Access login if you have built in security.
Some sort of If statement in conjuntion with the Login API, which you could find by googling. An example would be kind of like below (do this on the on load event maybe?) -
Dim UserName As String
UserName = GetUserName_TSB 'this is the windows login drawn from the LoginAPI function
If UserName = "XXXX" Or UserName = "XXXXX" Or UserName = "XXXXX" Or UserName = "XXXX" Then
Me.combobox.rowsource = 'Create a SELECT SQL query for whatever your tables / data is.
Else
Me.combobox.rowsource = 'Create a SELECT SQL query for whatever your tables / data is for other users
End If