UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Autopopulate Text In Textbox Controls, Access 2010    
 
   
MrWrap2
post Jan 11 2017, 10:28 AM
Post#1



Posts: 71
Joined: 10-January 17



Good Morning all,

pretty simple question, but I'm looking to build a form where a user inputs his employee ID in a text box control, and his/her last name, first name, and M.I. and date of last promotion (for example) are automatically displayed in other text boxes on the form. If for example, the individual needs to change the date of promotion, he can edit and that information is stored onto the tbl. Is this possible?

Thanks in advance,
-Mike
Go to the top of the page
 
theDBguy
post Jan 11 2017, 10:36 AM
Post#2


Access Wiki and Forums Moderator
Posts: 69,102
Joined: 19-June 07
From: SunnySandyEggo


Hi Mike,

Yes it's possible but it might be better to use a combobox to select the employee ID rather than enter it to avoid mistakes. If you want to try it, add an unbound combobox to your form and select the third option from the Wizard when it opens.

Hope it helps...

--------------------
Go to the top of the page
 
missinglinq
post Jan 11 2017, 10:37 AM
Post#3



Posts: 4,283
Joined: 11-November 02



In a Form using the Table containing this data as it RecordSource, place a Combobox, using the Combobox Wizard, and selecting the third option "Find a Record on my Form, based on the selection I made," with the EmployeeID as the Bound Field.

As they start to enter their ID the Combobox will filter down until the correct one is there and hitting enter will retrieve the Record, allowing it to be edited. If need be, you can lock all Controls except the date of promotion, on the Form.

Linq ;0)>

P.S. Day late and a dollar short...story of my life!

This post has been edited by missinglinq: Jan 11 2017, 10:38 AM

--------------------
Hope this helps!

The problem with making anything foolproof...is that fools are so darn ingenious!

All posts/responses based on Access 2003/2007
Go to the top of the page
 
MrWrap2
post Jan 11 2017, 10:42 AM
Post#4



Posts: 71
Joined: 10-January 17



Gentlemen,

Thank you.
This post has been edited by MrWrap2: Jan 11 2017, 10:44 AM
Go to the top of the page
 
theDBguy
post Jan 11 2017, 10:48 AM
Post#5


Access Wiki and Forums Moderator
Posts: 69,102
Joined: 19-June 07
From: SunnySandyEggo


Hi Mike,

You're welcome. Linq and I were happy to assist. Good luck with your project.

--------------------
Go to the top of the page
 
MrWrap2
post Jan 11 2017, 11:46 AM
Post#6



Posts: 71
Joined: 10-January 17



another question:

Is there a way to prompt a user to enter his/her ID before opening the form? Doing so would hopefully prevent someone from inadvertently modifying someone else's profile.
Go to the top of the page
 
theDBguy
post Jan 11 2017, 12:00 PM
Post#7


Access Wiki and Forums Moderator
Posts: 69,102
Joined: 19-June 07
From: SunnySandyEggo


Of course; but then again, what's stopping them from entering somebody else's ID number?

If you really want to restrict users to only see their own data, then perhaps you can implement something like their network user name or ID to automatically identify the user without asking them to enter anything.

Just my 2 cents...

--------------------
Go to the top of the page
 
MrWrap2
post Jan 11 2017, 12:10 PM
Post#8



Posts: 71
Joined: 10-January 17



It was only a thought. the 79 employees are all professionals, and I wouldn't suspect anything nefarious, simply a means to avoid inadvertent key strokes. In hindsight, probably not something worth pursuing.

But yet another question arises and I think it has something to do with relationships...

entering in the employee ID now displays the users' name and such, and one field populates displaying the billet identification code(BIC) (essentially the number assigned to a specific job, i.e. M1234 is the Team Lead at New Jersey) In one table (tblPeople) I have users ID, name, and the current BIC they fill. In another table (tblDuties) I have the BIC (M1234) and the title of the billet (Team Lead in NJ).

How do I display the title of the BIC in a separate text box?
Go to the top of the page
 
theDBguy
post Jan 11 2017, 12:18 PM
Post#9


Access Wiki and Forums Moderator
Posts: 69,102
Joined: 19-June 07
From: SunnySandyEggo


Hi,

One way is to use DLookup(). Another is to use a Combobox.

--------------------
Go to the top of the page
 
MrWrap2
post Jan 11 2017, 12:54 PM
Post#10



Posts: 71
Joined: 10-January 17



TheDBGuy,

ugh...here we go again with =DlookUp...

Based upon your help from before, I was able to create the solution using the following:

=DLookUp("[tblDuties]![DUTY]","tblDuties","[BIC]=" & "[lngAssignedDuty]")

THANKS!!
This post has been edited by MrWrap2: Jan 11 2017, 01:03 PM
Go to the top of the page
 
theDBguy
post Jan 11 2017, 01:33 PM
Post#11


Access Wiki and Forums Moderator
Posts: 69,102
Joined: 19-June 07
From: SunnySandyEggo


Congratulations! thumbup.gif

--------------------
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    29th March 2017 - 12:08 PM