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 Fields



 
 
Thread Tools Display Modes
  #1  
Old April 21st, 2010, 07:44 PM posted to microsoft.public.access.forms
Carlnlola
external usenet poster
 
Posts: 2
Default Auto Fill Fields

I have a database of contacts (names, addresses, phone numbers, emails). I
have created a table with this info already filled out (imported from Excel).
All I want to do is create a form with a single drop-down list where, when
the last name is selected, all the other fields automatically populate with
that person's correct information.

I have tried DLookup but that seems too cumbersome and doesn't work unless I
go to design view and back to form view. Is there not a simple function in
Access that lets me do what I need to without having to write code. I am NOT
a code writer, don't understand it, but willing to try if that's the only
option.

  #2  
Old April 21st, 2010, 09:29 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default Auto Fill Fields

It is easier to use a form filter. Install a combobox. Allow the combo wizard
to do this for you. Set it up for Last Name. Then right click on the combo,
go to the afterupdate event, click the button to the right, and start the
code builder. Then type:
Me.Filter = "[lname] = """ & Me.combo# & """"
Me.Filteron = True

The combo# will be displayed, like combo10 or combo22.
--
Milton Purdy
ACCESS
State of Arkansas


"Carlnlola" wrote:

I have a database of contacts (names, addresses, phone numbers, emails). I
have created a table with this info already filled out (imported from Excel).
All I want to do is create a form with a single drop-down list where, when
the last name is selected, all the other fields automatically populate with
that person's correct information.

I have tried DLookup but that seems too cumbersome and doesn't work unless I
go to design view and back to form view. Is there not a simple function in
Access that lets me do what I need to without having to write code. I am NOT
a code writer, don't understand it, but willing to try if that's the only
option.

.

  #3  
Old April 21st, 2010, 10:01 PM posted to microsoft.public.access.forms
Carlnlola
external usenet poster
 
Posts: 2
Default Auto Fill Fields

You are AWESOME! Thanks...works like a champ!

-Carl

golfinray wrote:
It is easier to use a form filter. Install a combobox. Allow the combo wizard
to do this for you. Set it up for Last Name. Then right click on the combo,
go to the afterupdate event, click the button to the right, and start the
code builder. Then type:
Me.Filter = "[lname] = """ & Me.combo# & """"
Me.Filteron = True

The combo# will be displayed, like combo10 or combo22.
I have a database of contacts (names, addresses, phone numbers, emails). I
have created a table with this info already filled out (imported from Excel).

[quoted text clipped - 9 lines]

.


  #4  
Old April 22nd, 2010, 12:54 PM posted to microsoft.public.access.forms
Carlnlola via AccessMonster.com
external usenet poster
 
Posts: 2
Default Auto Fill Fields

golfinray:

Ok...your solution works great but there's a small issue. My database
contains over 500 names and inevitably, there's duplicate last names. How do
I get the thing to show each person's info (right now, it filters out stuff
and the same info is displayed for 3 different Jones')

Thanks for taking the time to help out

-Carl

Carlnlola wrote:
You are AWESOME! Thanks...works like a champ!

-Carl

It is easier to use a form filter. Install a combobox. Allow the combo wizard
to do this for you. Set it up for Last Name. Then right click on the combo,

[quoted text clipped - 9 lines]

.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

  #5  
Old April 22nd, 2010, 01:55 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default Auto Fill Fields

One of the problems with using name is that there may be 4 or 5 Jones'. Can
you assign a unique ID number to each person, then search on the ID number.
You could even set up an ID like
001 Jones L
002 Jones T
003 Jones B
etc. Even better would be just to have cascading combo boxes (2) and have
a reference to the individuals, like Jones. Then the second combo you pick
T., B., or L. Look at the search feature Allen Browne has at
www.allenbrowne.com or Martin Greene at www.fontstuff.com
Good Luck!
--
Milton Purdy
ACCESS
State of Arkansas


"Carlnlola via AccessMonster.com" wrote:

golfinray:

Ok...your solution works great but there's a small issue. My database
contains over 500 names and inevitably, there's duplicate last names. How do
I get the thing to show each person's info (right now, it filters out stuff
and the same info is displayed for 3 different Jones')

Thanks for taking the time to help out

-Carl

Carlnlola wrote:
You are AWESOME! Thanks...works like a champ!

-Carl

It is easier to use a form filter. Install a combobox. Allow the combo wizard
to do this for you. Set it up for Last Name. Then right click on the combo,

[quoted text clipped - 9 lines]

.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

.

  #6  
Old April 22nd, 2010, 03:17 PM posted to microsoft.public.access.forms
Carlnlola via AccessMonster.com
external usenet poster
 
Posts: 2
Default Auto Fill Fields

Thanks for getting back to me. I already did what you suggested and just put
the Last Name with first initial. Seemed the easiest way and it works for
what I need it to do.

Thanks again for all your help.

Kindest Regards,
Carl

golfinray wrote:
One of the problems with using name is that there may be 4 or 5 Jones'. Can
you assign a unique ID number to each person, then search on the ID number.
You could even set up an ID like
001 Jones L
002 Jones T
003 Jones B
etc. Even better would be just to have cascading combo boxes (2) and have
a reference to the individuals, like Jones. Then the second combo you pick
T., B., or L. Look at the search feature Allen Browne has at
www.allenbrowne.com or Martin Greene at www.fontstuff.com
Good Luck!
golfinray:

[quoted text clipped - 16 lines]

.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

  #7  
Old April 22nd, 2010, 04:17 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Auto Fill Fields

You are only deferring the inevitable if you do not use a unique identifying
field as suggested. Unless the list will never grow, you almost certainly
will get duplicate combinations of last name, first initial.

Carlnlola wrote:
Thanks for getting back to me. I already did what you suggested and just put
the Last Name with first initial. Seemed the easiest way and it works for
what I need it to do.

Thanks again for all your help.

Kindest Regards,
Carl

One of the problems with using name is that there may be 4 or 5 Jones'. Can
you assign a unique ID number to each person, then search on the ID number.

[quoted text clipped - 12 lines]

.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

 




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


All times are GMT +1. The time now is 11:19 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.