选择要打开的表单基于表中的值 [英] Choose Form to open Based on Values in Table

查看:41
本文介绍了选择要打开的表单基于表中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我是VB编码Access的新手。目前我正在做一个有登录屏幕的dbase。在用户上或管理员登录我希望根据用户打开相关表格。或管理员标准。我有一个表包含UserList,UserName,密码,ID,AccessAS作为字段。在AccessAS中字段只有用户字段和管理员值。所以Administartors有管理员。价值和其他Usres有用户。如果用户登录时会为用户打开表单,或者当管理员登录时通过查看与登录的个人对应的表中的AccessAS值来打开管理表单,我将不胜感激。


感谢大家提前。

Hi All

I''m very new to VB coding for Access. At present I''m doinga dbase which has a logon screen. Upon "User" or "Admin" logon I would like a relevant form be opened based on "User" or "Admin" criterion. I have a table that contains UserList with UserName, Password, ID, AccessAS as fields. In The "AccessAS" field there are only "User" and "Admin" values. So Administartors have "Admin" value and other Usres have "User". I would appreciate any help with code that will open a form for a User when a User logs on or an Admin form when an Admin Logs on by looking the AccessAS value in the table corresponding to the individual that is logging on.

Thanking you all in Advance.

推荐答案

你还没有包含任何现有代码来添加代码,所以这将有一般。


当您确定了用户并确认其密码有效后,访问[AccessAS]值将字符串变量设置为一个表单的名称,如果它'' s用户,另一个如果是管理员。接下来,在表单打开命令中使用此字符串。
You haven''t included any existing code into which to add code, so this will have to be general.

When you have determined the user, and confirmed their password is valid, access the [AccessAS] value set a string variable to the name of one form if it''s "User", and the other if it''s "Admin". Next, use this string in your form open command.


或(伪代码):
Or (pseudo cod):
展开 | 选择 | Wrap | 行号


你好NeoPa


这是真的我应该在这里发布代码。请看下面。

它包括我现在尝试更改为注释的尝试。
Hi NeoPa

That is true I should have posted the code here. Please see below.
It includes my attempts in which now I have changed into comments.
展开 | 选择 | 换行 | 行号


这篇关于选择要打开的表单基于表中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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