单击打开按钮时限制对表的访问。 [英] Restrict access to a table when open button is clicked.

查看:59
本文介绍了单击打开按钮时限制对表的访问。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个需要登录才能获得访问权限的数据库。有些人是''管理员''其他人不是。双击时我有一个隐藏按钮打开一个Employees表。此表用于在用户登录时检查用户的用户名和密码,还包含访问级别和网络用户名等信息。我需要做的是,当双击这个按钮时,它会对employees表进行检查以查看用户访问级别是否为Admin,如果是他们可以访问所述表并且可以更新它以便新用户可以添加允许他们登录,这可能吗?我目前用于打开表格的代码如下。

展开 | 选择 | Wrap | 行号

解决方案

查看返回用户名的功能(NT登录) )当前用户。有了这个,您通常不需要用户单独登录。


您的表包含每个用户具有的访问级别,因此请在表中查找当前用户并确定他们的[AccessLevel]来自他们的。一旦拥有[AccessLevel],只有当[AccessLevel]匹配该代码所需的内容时,您才能简单轻松地运行某些代码。





我想我要撕掉我的头发。我已经开始在我的代码片段上使用Dlookup函数,但是我在新的水中并且我不知道我是否正在吠叫正确的树。我知道我在代码中出错的地方我只是不知道如何纠正它。 ''If''函数是我认为的问题,但我可能完全错了,所有这些都可能是错误的。

展开 | 选择 | Wrap | 行号

很抱歉爆破任何气泡Ste,但我没有看到我建议的逻辑迹象。也许如果你解释了你正在使用的数据结构,我们可以帮助更多。第一项工作是获取用户登录ID。没有它,其余的都无处可去。如果你从不在起跑线附近的任何地方,你就不可能完成一场比赛;-)

不要扯掉任何头发,只需一步就可以了。时间。如果有一个步骤你就无法管理,那就不要随意推进(因为你会发现自己在沙漠中徘徊),停下来报告你所坚持的事情。


第一步 - 提供有关您正在使用的数据的信息。

第二步 - 将Mary的代码放入链接的文章中。


Hi

I have a database that requires a log in to gain access. Some people are ''Admin'' others aren?t. I have a hidden button when double clicked opens an Employees table. This table is used to check people?s username and password when they log in, it also has information like Access Level and network username. what I need to happen is when this button is double clicked it runs a check against the employees table to see if the users access level is ''Admin'', if it is they get access to said table and can update it so new users can be added allowing them to log in, is this possible? The code I am currently using to open the table is below.

Expand|Select|Wrap|Line Numbers

解决方案

Check out Function to Return UserName (NT Login) of Current User. With this you generally have no need for the user to log in separately.

Your table contains what level of access each user has, so look up in the table for the current user and determine their [AccessLevel] from their. Once you have the [AccessLevel] you can simply and easily run certain code only if the [AccessLevel] matches what you require for that code.


Hi

I think I am going to rip my hair out. I have had a go at using the Dlookup function on my piece of code however I''m in new water and don''t really know if I am even barking up the right tree. I know where I am going wrong in the code I just don’t know how to right it. The ''If'' function is the problem I think but again I could be totally wrong and all of it may be wrong.

Expand|Select|Wrap|Line Numbers


Sorry to burst any bubbles Ste, but I see no signs here of the logic I suggested. Perhaps if you explained the data structure you''re working with we could help some more. The first job is to get the user logon ID though. Without that the rest is going nowhere. You can''t finish a race if you never go anywhere near the start-line ;-)

Don''t rip out any hair, just take it one simple step at a time. If there''s a step you can''t manage then don''t push on randomly (as you''ll find yourself wandering in the desert), stop and report what you''re stuck on.

First step - Provide information as to what data you''re working with.
Second step - put Mary''s code in from the linked article.


这篇关于单击打开按钮时限制对表的访问。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆