473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Set the value of a textbox based on the value of another textbox

manoj9849967222
HI

I have two tables with fields say Emp ID & Employee Name & the other one with Emp ID, Employee Name & Phone no. I have designed a form for the 2nd Table with fields Emp ID, Employee Name & Phone no.

I am trying that when i enter the Emp ID in the Form it should automatically display the Emp name which is present in the first table.

I have created a relation between the two tables. But still i am not able to do it.

Could you please suggest.

Regards
Manoj.
Aug 1 '07 #1
4 2317
JustJim
407 Expert 256MB
HI

I have two tables with fields say Emp ID & Employee Name & the other one with Emp ID, Employee Name & Phone no. I have designed a form for the 2nd Table with fields Emp ID, Employee Name & Phone no.

I am trying that when i enter the Emp ID in the Form it should automatically display the Emp name which is present in the first table.

I have created a relation between the two tables. But still i am not able to do it.

Could you please suggest.

Regards
Manoj.
If one Employee can only have one name, one ID and one Phone No, then you only need one table. There is no need for another table unless one (for example) employee can have many (for example) Customers. This is when you need another table with linking relationships between them.

Let us know how you go.

Jim
Aug 2 '07 #2
missinglinq
3,532 Expert 2GB
I have two tables with fields say Emp ID & Employee Name & the other one with Emp ID, Employee Name & Phone no. I have designed a form for the 2nd Table with fields Emp ID, Employee Name & Phone no.

I agree with Jim! Given the above, it makes absolutely no sense to have two tables to hold this information. Having both EmpID and Employee Name in two tables violates The Cardinal Rule of relational databases; with the exception of Primary/Foreign keys, never store the same information in more than one table! You need to scrap the table that just contains the Emp ID & Employee Name and go with the one that contains Emp ID, Employee Name & Phone Number.

The easiest way to retrieve a given record, which is what you're trying to do, is to create a form (which you say yuo've already done) using this table or a query that includes this table as the Record Source.

Place a combo box (dropdown box) on the form
Ehrn the Combobox Wizard comes up:
Select "Find a record on my form based on the value I've selected..."
Next
Select the appropriate identifying field to appear in the Combo box (EmpID in your case)
Next
Size the Combo box column
Next
Name the combo box
Finish

Now the user can use the dropdown arrow of the combo box to retrieve the data or simply start typing the identifying data in and the combo box will start to autocomplete the entry. When the correct entry is found hit <Enter> and the appropriate data should be retrieved.

Good Luck!

Linq ;0)>
Aug 2 '07 #3
Thank you Missinglinq & Jim..

Its working. I was unnecessarly creating a 2nd table.

Thank you again.






I have two tables with fields say Emp ID & Employee Name & the other one with Emp ID, Employee Name & Phone no. I have designed a form for the 2nd Table with fields Emp ID, Employee Name & Phone no.

I agree with Jim! Given the above, it makes absolutely no sense to have two tables to hold this information. Having both EmpID and Employee Name in two tables violates The Cardinal Rule of relational databases; with the exception of Primary/Foreign keys, never store the same information in more than one table! You need to scrap the table that just contains the Emp ID & Employee Name and go with the one that contains Emp ID, Employee Name & Phone Number.

The easiest way to retrieve a given record, which is what you're trying to do, is to create a form (which you say yuo've already done) using this table or a query that includes this table as the Record Source.

Place a combo box (dropdown box) on the form
Ehrn the Combobox Wizard comes up:
Select "Find a record on my form based on the value I've selected..."
Next
Select the appropriate identifying field to appear in the Combo box (EmpID in your case)
Next
Size the Combo box column
Next
Name the combo box
Finish

Now the user can use the dropdown arrow of the combo box to retrieve the data or simply start typing the identifying data in and the combo box will start to autocomplete the entry. When the correct entry is found hit <Enter> and the appropriate data should be retrieved.

Good Luck!

Linq ;0)>
Aug 2 '07 #4
missinglinq
3,532 Expert 2GB
Yes you were! Life, including Access, is complicated enough! No need to make it more so!

Glad you got it figured out! Let us know if we can help further!

Linq ;0)>
Aug 2 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ronny Sigo | last post by:
Hello all, On my form I have an unbound combobox based on a query displaying two rows. The rows are : 1) Zipcode (Leftmost (In the query this field is sorted ascending 2 City The...
0
by: gary b | last post by:
My forehead is sore from beating it against the wall. Can anyone help? I've started drinking again because of this problem! Setup: ContestantTbl = table ('one' side) HorseTbl = table ...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
0
by: colleen1980 | last post by:
Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the...
14
by: ZaphodBBB | last post by:
Hi O.S. = Windows XP Pro all Service Packs Access = 2003 I have a form with 2 tabbed pages. On the second page I have a subform which populates in Datasheet view with a list of items. One...
3
by: technocraze | last post by:
Hi community experts, May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox? This means that once the user enters...
5
by: vsteshenko | last post by:
Hello, This is my second post to the any usernet group and the first one was posted to the wrong one. I am currently working on creating an order form for sales associates at my work to be used...
1
by: danielgoss | last post by:
Hi I have a report that has loads of textboxes that calculate things based on the value on another textbox in the report. I have put a hidden textbox on my report that gets its value from an...
1
Plater
by: Plater | last post by:
I feel like this question has been asked before, but I couldn't find it. I think I am missing something obvious. Basically I am going to have a DataGridView with two columns. One textbox, one...
2
by: dbdb | last post by:
Hai, need a help please. i have a form to view the query subform 1. form name : form1 2. query subform name : subform1 3. textbox name : txtclass1 4. command button name : cmd1 i want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.