扩展LogIn表以根据用户状态显示表单 [英] Extension of LogIn Table to display form based on user status

查看:104
本文介绍了扩展LogIn表以根据用户状态显示表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

G''day,


我有一个愚蠢而简单的问题需要一些指导。


由于这种方式我们的网络已设置,我无法使用Access的组权限,并且必须通过数据库中的登录表实现登录过程。这很好用。我现在已扩展此表以包含有关授权用户的更多数据?高级用户,团队负责人,&主持人。


根据用户的状态(或者作为普通用户的默认状态),我想显示特定于该用户的表单?地位,例如如果用户在登录表中作为高级用户是真的,我想要一个强大的用户?要显示的表单。有时候我们会有团队负责人,他们也是协调员,所以我需要检查团队负责人和协调员状态 - 因此我有四种情况(表格)可以加载。 1.如果Power user = true,则加载Power用户表单; 2.如果团队领导= true,则加载团队领导表格; 3.如果主持人=真,那么加载辅助者形式; 4.如果团队领导和辅导员都是真的,那么加载团队协调员表格。


登录表包括:

lngEmpID?自动编号(PK)

txtUserID? txt

txtpword - txt

txtfirstname? txt

团队负责人?布尔值(是/否)

辅导员?布尔值(是/否)

功率?布尔(Y / N)


我有以下表格:

frmLogOn

开始辅导员

启动团队协调人

启动电源

启动团队负责人


这是我的代码,它适用于登录部分过程:


G''day,

I have a silly and simple problem that I need some guidance with.

Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log in procedures via a log in table within the database. This works fine. I have now expanded this table to include further data about the authorised user ? Power User, Team Leader, & Facilitator.

Depending on the user?s status as to which one of these they are (or as the default status as a regular user) I want to display a form specific for that user?s status, e.g. If the user is true in the log in table as a Power user, I want a ?power user? form to be displayed. Sometimes we will have team leaders who are also facilitators so I need to check both Team Leader and Facilitator status - thus I have four situations (forms) to load up. 1. If Power user = true then load Power user form; 2. if team leader = true then load Team leader form; 3. if facilitator = true then load facilitator form; and 4. if both team leader and facilitator = true then load team facilitator form.

The log in table consists of:
lngEmpID ? Autonumber (PK)
txtUserID ? txt
txtpword - txt
txtfirstname ? txt
Team Leader ? Boolean (Y/N)
Facilitator ? Boolean (Y/N)
Power ? Boolean (Y/N)

I have the following forms:
frmLogOn
Start Facilitator
Start Team Facilitator
Start Power
Start Team Leader

This is the code I have that works fine for the log in part of the process:

Class

展开 | 选择 | Wrap | 行号

推荐答案

尚不确定导致问题的是什么,但是想请你开始删除课程。有两个相似的命名函数可能会混淆Access。

还要确保模块名称与函数不同。


然后再试一次让我知道哪里出错了。

最好放置一个断点(点击左边的规则,这样就会出现一个点)并触发代码。当命中断点时,使用F8键单步执行代码,看看会发生什么,并使用上面的光标查看它们的值。


Nic; o)
Not yet sure what''s causing the trouble, but would like to ask you to start with removing the class. Having two similar named functions can confuse Access.
Also make sure that the modulename isn''t the same as the function.

Then try again and let me know where it goes wrong.
Best to place a breakpoint (click the left rules so a dot appears) and trigger the code. When the breakpoint is hit use the F8 key to single step through the code to see what happens and use the cursor above fields to see their value.

Nic;o)


G''day Nic!


感谢您的回复。


我已删除该课程模块=)非常感谢。


我在不同的地方设置了断点,但是因为我必须实际运行表单才能触发代码(我似乎无法从内部触发VB窗口 - 可能是因为它从用户输入运行?)当我回到代码时我实际上看不到它在做什么。


我在两个cboUserID上设置监视和Power变量,这显示< out of context>对彼此而言;和清空对于数据类型。这有多大帮助吗?


运行时表单会发生什么,它会踢我(试试这个 - 我已经注释掉了application.quit命令)与LogIn Sub对应。


将power变量声明为布尔值,这会影响我的Dlookup - 登录表中的Power字段是一个布尔值,我是否可以使用该数据类型声明此变量?


frmLoader子句的语法是否正常?我想知道此时Power字段中的值是true还是false,如果true,则加载Start power表单。我把Call frmLoader放在了错误的地方吗?


再次感谢=)


Jodi
G''day Nic!

Thanks for your reply.

I''ve removed that class module =) thanks for that.

I set breakpoints at various places, however as I have to actually run the form to trigger the code (I can''t seem to trigger from within the VB window - possibly because its running from the user input?) when I flick back to the code I can''t actually see what its doing.

I set watches on the both cboUserID and Power variables and this shows "<out of context>" for both; and "Empty" for the data types. Is this much help at all?

What happens with the form when I run it is, it will kick me (try to that is - I''ve commented out the application.quit command) which corresponds with the LogIn Sub.

With the power variable declared as a boolean, will this affect my Dlookup - the Power field in the log in table is a boolean, am I right to declare this variable with that data type?

Does the syntax for the frmLoader sub look okay? I want to know at this point if the value in the Power field is true or false and if true load the Start power form. Have I put the Call frmLoader in the wrong place?

Thanks again =)

Jodi


在行上放置一个断点:
Place a breakpoint on the line with:
展开 | 选择 | Wrap | 行号


这篇关于扩展LogIn表以根据用户状态显示表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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