If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
auto fill a form in Microsoft Access
I have a form, and i would like it to auto fill two to three text
box's,(first name, last name and middle name) based on a employee id number which is entered into the first text box. Is there any way to do this? I would like access to match a employee id which is entered to a table , and then auto fill the remainding fields(first name, last name, and middle name) Thanks |
#2
|
|||
|
|||
Hi.
There are two easy ways to do this. Either base your form on a query that includes the name fields, or use multiple uses of the Column property. The first seems more straightforward in this instance. For those instances when you'd like other fields to display based on a choice from a combo box, include all desired fields in the Row Source of the combo box, and set the Control Source property as follows: =YourComboBoxName.Column(x), where x indicates the column number, beginning with 0. HTH Sprinks "atnsx80" wrote: I have a form, and i would like it to auto fill two to three text box's,(first name, last name and middle name) based on a employee id number which is entered into the first text box. Is there any way to do this? I would like access to match a employee id which is entered to a table , and then auto fill the remainding fields(first name, last name, and middle name) Thanks |
#3
|
|||
|
|||
On Tue, 16 Nov 2004 12:40:07 -0800, "atnsx80"
wrote: I have a form, and i would like it to auto fill two to three text box's,(first name, last name and middle name) based on a employee id number which is entered into the first text box. Is there any way to do this? I would like access to match a employee id which is entered to a table , and then auto fill the remainding fields(first name, last name, and middle name) Thanks If you're trying to store the name information redundantly in a second table, DON'T. These values should exist ONLY in the Employee table. I'd suggest basing your Combo Box (cboEmployee) on a Query: SELECT EmployeeID, [LastName] & ", " & [FirstName] & (" " + [MiddleName]) ORDER BY LastName, FirstName, MiddleName; Set the column count to 2 and put a textbox on the form with a Control Source to =cboEmployee.Column(1) to *display* the name (without storing it redundantly). John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#4
|
|||
|
|||
John solution works great but how do you take it one step more and save the
data in the database. By changing the control source I lose the ability to save this field. "John Vinson" wrote: On Tue, 16 Nov 2004 12:40:07 -0800, "atnsx80" wrote: I have a form, and i would like it to auto fill two to three text box's,(first name, last name and middle name) based on a employee id number which is entered into the first text box. Is there any way to do this? I would like access to match a employee id which is entered to a table , and then auto fill the remainding fields(first name, last name, and middle name) Thanks If you're trying to store the name information redundantly in a second table, DON'T. These values should exist ONLY in the Employee table. I'd suggest basing your Combo Box (cboEmployee) on a Query: SELECT EmployeeID, [LastName] & ", " & [FirstName] & (" " + [MiddleName]) ORDER BY LastName, FirstName, MiddleName; Set the column count to 2 and put a textbox on the form with a Control Source to =cboEmployee.Column(1) to *display* the name (without storing it redundantly). John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#5
|
|||
|
|||
John solution works great but how do you take it one step more and save
the data in the database. By changing the control source I lose the ability to save this field. Notice John's comment -- "to *display* the name (without storing it redundantly)." You do NOT want to store it in that table. You already have it stored and there is no reason to store it again. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm |
#6
|
|||
|
|||
In my senaro I'm using our accounting software table to do a lookup. Item
Location and Bin Location. So If I shouldn't save this data how can I redisplay this lookup in other forms where I have the item number saved but not the bin? "Lynn Trapp" wrote: John solution works great but how do you take it one step more and save the data in the database. By changing the control source I lose the ability to save this fIield. Notice John's comment -- "to *display* the name (without storing it redundantly)." You do NOT want to store it in that table. You already have it stored and there is no reason to store it again. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm |
#7
|
|||
|
|||
If you have it stored once and can use it for a lookup, then you can use the
same SQL statement to do the same lookup in another form. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm "mccloud" wrote in message ... In my senaro I'm using our accounting software table to do a lookup. Item Location and Bin Location. So If I shouldn't save this data how can I redisplay this lookup in other forms where I have the item number saved but not the bin? "Lynn Trapp" wrote: John solution works great but how do you take it one step more and save the data in the database. By changing the control source I lose the ability to save this fIield. Notice John's comment -- "to *display* the name (without storing it redundantly)." You do NOT want to store it in that table. You already have it stored and there is no reason to store it again. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm |
#8
|
|||
|
|||
On Tue, 7 Dec 2004 06:43:06 -0800, "mccloud"
wrote: In my senaro I'm using our accounting software table to do a lookup. Item Location and Bin Location. So If I shouldn't save this data how can I redisplay this lookup in other forms where I have the item number saved but not the bin? Your Accounting software should be able to use a Query instead of a Table to do its lookup. If it can't, post back. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#9
|
|||
|
|||
That worked except... any form that uses this query will not allow my "delete
record" button to work. Any Idea's "John Vinson" wrote: On Tue, 7 Dec 2004 06:43:06 -0800, "mccloud" wrote: In my senaro I'm using our accounting software table to do a lookup. Item Location and Bin Location. So If I shouldn't save this data how can I redisplay this lookup in other forms where I have the item number saved but not the bin? Your Accounting software should be able to use a Query instead of a Table to do its lookup. If it can't, post back. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#10
|
|||
|
|||
On Tue, 7 Dec 2004 11:27:06 -0800, "mccloud"
wrote: That worked except... any form that uses this query will not allow my "delete record" button to work. Any Idea's See the online help for "How do I create an updateable query", or open the Query in SQL view and post the SQL code here. Not all queries are updateable, but a simple join query should be, *provided* you have a unique Index (such as a Primary Key) in the "one" side table's joining field, and a relationship defined between the two tables. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Acess 2002 Service Pack 3 | J. Haney | General Discussion | 2 | July 29th, 2004 12:59 AM |
Error while running Access MDE | Hemil | General Discussion | 2 | June 21st, 2004 01:03 PM |
Linking Excel data through Access to use a Form as an Interface | Laura | Links and Linking | 0 | March 23rd, 2004 03:59 PM |