欢迎使用“用户名”登录后 [英] Welcome "username" after log in

查看:50
本文介绍了欢迎使用“用户名”登录后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的opens_form上我只有:


Username1_label(这是一个标签)


Combo4(这是一个组合框)列出我的表username_T中的所有用户名。


和一个登录按钮,如果从组合框中选择了用户名,则可以导航到数据库中的navigation_form( Combo4)。它还关闭了opening_form并自动保存。如果没有从组合框中选择用户名,它会提示你一个MsgBox请选择一个用户名。



现在,一旦您导航到navigation_form,我希望在表单顶部显示一条友好的消息,其中显示欢迎用户名"使用用户名是用户名在组合框中的上一个表单中选择。


任何帮助都将不胜感激。

On my opening_form all that I have is:

Username1_label (which is a label)

Combo4 (which is a combo box that lists all the usernames from my table username_T)

and a Login Button, which allows you to navigate to the navigation_form in the database, if a username has been selected from the combo box (Combo4). It also closes the opening_form and automatically saves.If no username is selected from the combo box it prompts you with a MsgBox "please select a username".


Now, once you have navigated to the navigation_form, I would like for a friendly message to appear across the top of the form that says "Welcome "username"" with the "username" being the "username" selected on the previous form in the combo box.

Any help would be greatly appreciated.

推荐答案

你有几个选项,保持登录表单处于打开状态,以便您可以使用所选用户名引用控件,将其保存到全局变量中并创建VBA函数以返回其值,或者在表中标记记录并使用查找来查找谁已登录。仅当数据库是独立的时,最后一个选项才可行。
You have a few options, leave the login form open so you can reference the control with the chosen user name, save it into a global variable and create a VBA function to return its value, or mark the record in the table and use a lookup to find who''s logged in. The last option is viable only if the database is a standalone.


根据您当前登录用户的存储方式,有两种方法可以执行此操作。基本的是你需要获取登录人员的用户名并将其分配给变量(例如strUser)。如果包含文本Welcome username 的控件是标签,那么在您的navigation_form的OnLoad事件中,使标签的标题为
There are a couple of ways to do this depending on how you are storing the currently logged in user. The basic thing is that you need to get the username of the person logged in and assign it to a variable (for example strUser). If the control that holds the text "Welcome username is a label, then in your navigation_form''s OnLoad event, make the label''s caption be
展开 | 选择 | Wrap | 行号


我真的不知道如何存储登录用户的名字。我希望能够存储用户名并关闭opening_form。 ..这可能吗?
I really don''t know how to store the name of the user logged in. I would like to be able to store the name of the user and also close the opening_form... Is that possible??


这篇关于欢迎使用“用户名”登录后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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