A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

auto fill a form in Microsoft Access



 
 
Thread Tools Display Modes
  #1  
Old November 16th, 2004, 08:40 PM
atnsx80
external usenet poster
 
Posts: n/a
Default 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  
Old November 16th, 2004, 09:18 PM
Sprinks
external usenet poster
 
Posts: n/a
Default

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  
Old November 17th, 2004, 12:53 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old December 7th, 2004, 02:21 PM
mccloud
external usenet poster
 
Posts: n/a
Default

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  
Old December 7th, 2004, 02:28 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default

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  
Old December 7th, 2004, 02:43 PM
mccloud
external usenet poster
 
Posts: n/a
Default

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  
Old December 7th, 2004, 02:57 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default

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  
Old December 7th, 2004, 05:17 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old December 7th, 2004, 07:27 PM
mccloud
external usenet poster
 
Posts: n/a
Default

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  
Old December 7th, 2004, 09:58 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.