Auto Fill Fields

C

Carlnlola

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.
 
G

golfinray

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.
 
C

Carlnlola

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,
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]
 
C

Carlnlola via AccessMonster.com

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
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]
 
G

golfinray

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 said:
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
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]

--



.
 
C

Carlnlola via AccessMonster.com

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.
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]
 
B

BruceM via AccessMonster.com

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.
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top