473,657 Members | 2,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Employee "Login", Lookup and display name from number

Hello,

I'm making a data entry form that i would like to have display the
operators name.

So far i have a preceeding "Login" form in which the operator inputs
his/her employee number into a text box "txtopnumbe r".

They then click a button which sets the value:

Private Sub Command2_Click( )
gopnumber = Me!txtopnumber

Then i create a module to return that value:

Public Function getopnumber() As String
getopnumber = gopnumber

So on the data entry form i have just been calling up the value by
putting
getopnumber() as the control source.

My question is, I would like the operators to input his/her employee
number in the login form and have somethat looks up the employees name
and displays that on the data entry form. (Instead of just inputting a
number and displaying the number elsewhere I'd like to input a number
and display the associated name elsewhere)

Thanks for your help!
Gavin

Sep 19 '07 #1
3 2028
Gavin,

I think you're working too hard...

If you have a table "Emps" containing the "EmpID" and "EmpName", and
your form has the "EmpID" in "TB_EmpID" and the "EmpName" in
"TB_EmpName ", the following code in in the AfterUpdate event of
"TB_EmpID" should do what you want.

Private Sub TB_EmpID_AfterU pdate()
Me.EmpName = DLookup("EmpNam e", "TBL_Emps", "EmpID = '" &
Me.TB_EmpID & "'")
End Sub

I'm not sure if you've got the ID and the Name on the same form or
different forms, so I will leave the exact "addressing " syntax up to
you.

Good luck.

Patrick

On Sep 19, 11:18 am, gavm...@yahoo.c om wrote:
Hello,

I'm making a data entry form that i would like to have display the
operators name.

So far i have a preceeding "Login" form in which the operator inputs
his/her employee number into a text box "txtopnumbe r".

They then click a button which sets the value:

Private Sub Command2_Click( )
gopnumber = Me!txtopnumber

Then i create a module to return that value:

Public Function getopnumber() As String
getopnumber = gopnumber

So on the data entry form i have just been calling up the value by
putting
getopnumber() as the control source.

My question is, I would like the operators to input his/her employee
number in the login form and have somethat looks up the employees name
and displays that on the data entry form. (Instead of just inputting a
number and displaying the number elsewhere I'd like to input a number
and display the associated name elsewhere)

Thanks for your help!
Gavin

Sep 20 '07 #2
On Wed, 19 Sep 2007 15:18:03 -0000, ga*****@yahoo.c om wrote:

Something like:
DLookup("EmplNa me", "tblEmploye es", "OpNumber=" & getopnumber())

-Tom.

>Hello,

I'm making a data entry form that i would like to have display the
operators name.

So far i have a preceeding "Login" form in which the operator inputs
his/her employee number into a text box "txtopnumbe r".

They then click a button which sets the value:

Private Sub Command2_Click( )
gopnumber = Me!txtopnumber

Then i create a module to return that value:

Public Function getopnumber() As String
getopnumber = gopnumber

So on the data entry form i have just been calling up the value by
putting
getopnumber( ) as the control source.

My question is, I would like the operators to input his/her employee
number in the login form and have somethat looks up the employees name
and displays that on the data entry form. (Instead of just inputting a
number and displaying the number elsewhere I'd like to input a number
and display the associated name elsewhere)

Thanks for your help!
Gavin
Sep 20 '07 #3
guys, these worked. Thanks!
Sep 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1434
by: Twitch | last post by:
Turns out I can only use Windows Authentication for the website. So I ask again. Is there a way or method of knowing when a "Window Authentication" logon fails? Maybe a system exception I can catch? or an event? Thanks.
2
5351
by: Murphy | last post by:
Our website contains subdirectories for each subsidiary company, each company has it's own look and feel to the pages in their subdirectory although they are all part of the main website. The code below in the Web.Config file defines the authentication as forms and the aspx file required for login if the user is unauthenticated... this works well for the root level company web pages however when a user viewing the website of SubCompanyA...
6
2435
by: Jerry Higgins | last post by:
I added a SqlDataAdapter to a web form, created a data connection, and generated a dataset. I then connected it to a DataGrid control. When I do this using the SqlServer database on my machine everything works fine. When I do it using a SqlServer database on another machine I get the "Login failed for user sa" error. However, when I right click on the SqlDataAdapter and click "Preview Data" it brings back the data OK. Why would it...
0
1000
by: VB Programmer | last post by:
I followed this article on creating a rollover button for ASP.NET: http://aspnet.4guysfromrolla.com/articles/091703-1.aspx Question: When I click on the button I would like code-behind to run. Is this possible? If not, do I have to run java-script to process the image button? It is a login button. I need to verify the login/password fields against a db then proceed....
0
2123
by: Mr.KisS | last post by:
Hello. I'm under Windows XP PRO SP1, IIS 5.1 ans SQL SERVER 2005 Express. When i try to open a connexion with : <connectionStrings> <add name="AppCnxStr" connectionString="Server=KLEO\SQLEXPRESS;Integrated Security=True;Database=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\wizou.mdf" providerName="System.Data.SqlClient" />
2
10641
by: Mr.KisS | last post by:
Hello. I'm under Windows XP PRO SP1, IIS 5.1 ans SQL SERVER 2005 Express. When i try to open a connexion with : <connectionStrings> <add name="AppCnxStr" connectionString="Server=KLEO\SQLEXPRESS;Integrated Security=True;Database=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\wizou.mdf" providerName="System.Data.SqlClient" />
1
2106
by: fl | last post by:
I am running ASPNET on my local machine. I have a problem when I try to connect to a SQL server database table. The data looks good when I right click SqlDataAdapter1 to preview the data. When F5 to run it, I get this error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection..." Here is my code (they are all generated by the wizard): Public Class WebForm1 Inherits System.Web.UI.Page
2
1901
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
I have a .NET 1.1 component trying to connect to a database but I keep getting the following message when the exception is thrown: @"Login failed for user '\'." It appears that no user and role are being passed to the connection object, otherwise it would surely give the name of the user who was being denied. Has anyone come up against this before? A search told me to set both SQL and Windows authorisation on the SQL Server, but...
0
1313
by: obs | last post by:
Hi all. I have a page with a login control. I was wondering what's the way to use the remember me login control. I know it has something to do with cookies, but since I am a total noobie, I don't know how to do it. Please help, thanks in advance.
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.