Populate field based on data from another field

A

Ana

I have a form called POP form that uses data from a table BnkPtnr Table. I want to be able to select the BnkPtnr # (ID for bank partner) from a popup list in POP form and have the corresponding BnkPtnr Name automatically appear on the following field BnkPtnr Name (without having to type it). BnkPtnr Table has two fields ID and Name. I tried a dlookup function but this didn't work.

Thanks,

Ana
 
T

tina

add the BnkPtnrName field to the combobox's RowSource.
we'll assume that the BnkPtnrID is the first column and
the BnkPtnrName is the second column.
set the number of columns to 2.
set the column widths to 1"; 0"
now the BnkPtnrName column is there but the user won't see
it.
set the ControlSource on the following field to
=ComboboxName.Column(1)

hth

-----Original Message-----
I have a form called POP form that uses data from a table
BnkPtnr Table. I want to be able to select the BnkPtnr #
(ID for bank partner) from a popup list in POP form and
have the corresponding BnkPtnr Name automatically appear
on the following field BnkPtnr Name (without having to
type it). BnkPtnr Table has two fields ID and Name. I
tried a dlookup function but this didn't work.
 
J

John

Ana

Is the "popup list" a combo box or list box that you are refering to? What it sounds like is that you need a combo box with 2 columns, one for BnkPtnr # and one for BnkPtnr Name. You can do this with a Table/Query row source type and have the Row Source to select the 2 fields
Row Source
SELECT [BnkPtnr Table].[BnkPtnr #], [BnkPtnr Table].[BnkPtnr Name] FROM [BnkPtnr Table] GROUP BY [BnkPtnr Table].[BnkPtnr Name], [BnkPtnr Table].[BnkPtnr #] ORDER BY [BnkPtnr Table].[BnkPtnr Name]

Your Bound Column should be

Your Bank Partner Name text box control source should be: =cboBnkPtnrNu
the cboBnkPtnrNum is what I named a combo box Bank Partner Number

HTH

Joh


----- Ana wrote: ----

I have a form called POP form that uses data from a table BnkPtnr Table. I want to be able to select the BnkPtnr # (ID for bank partner) from a popup list in POP form and have the corresponding BnkPtnr Name automatically appear on the following field BnkPtnr Name (without having to type it). BnkPtnr Table has two fields ID and Name. I tried a dlookup function but this didn't work

Thanks

Ana
 
A

Ana

John,
Thx for your help. I know that I'm doing something wrong b/c I am still stuck. Here's what I did:
I set all the combo box info you gave me into my field name BnkPtnr # on my POP form. Then I set the control source on my BnkPtnrName field on my POP form to cboBnkPtnrNum. However, I don't know how to assign cboBnkPtnrNum = BnkPtnr # so I get an error #name? on the BnkPtnrName field in POP form. I tried to set the control source to BnkPrtnr# but then I get the bank partner number displayed rather than the bank partner name.

Can you help me?

Thx
Ana

----- John wrote: -----

Ana,

Is the "popup list" a combo box or list box that you are refering to? What it sounds like is that you need a combo box with 2 columns, one for BnkPtnr # and one for BnkPtnr Name. You can do this with a Table/Query row source type and have the Row Source to select the 2 fields.
Row Source:
SELECT [BnkPtnr Table].[BnkPtnr #], [BnkPtnr Table].[BnkPtnr Name] FROM [BnkPtnr Table] GROUP BY [BnkPtnr Table].[BnkPtnr Name], [BnkPtnr Table].[BnkPtnr #] ORDER BY [BnkPtnr Table].[BnkPtnr Name];

Your Bound Column should be 1

Your Bank Partner Name text box control source should be: =cboBnkPtnrNum
the cboBnkPtnrNum is what I named a combo box Bank Partner Number.

HTH,

John


----- Ana wrote: -----

I have a form called POP form that uses data from a table BnkPtnr Table. I want to be able to select the BnkPtnr # (ID for bank partner) from a popup list in POP form and have the corresponding BnkPtnr Name automatically appear on the following field BnkPtnr Name (without having to type it). BnkPtnr Table has two fields ID and Name. I tried a dlookup function but this didn't work.

Thanks,

Ana
 
T

tina

hi ana.
i'm actually responding to your post from this morning
12/5. for some reason it shows up in my newsreader, but
not on Microsoft's newsgroups webpage. anyway, don't be
discouraged. it can be difficult to understand
explanations in this format, for both the poster AND
the "reply-er".

the solution i suggested should have worked for you, so
it's possible i didn't visualize your setup as it really
is. if you want to email your db to me, i can try to set
it up for you and send it back so you can see how i did it.

if you'd like to take me up on that, do the following:
1. compact your db.
2. make a copy, and remove any proprietary data from the
tables (put in a few "dummy" records so i have something
to work with).
3. compact again.
4. i have Access 2000. you can send a '97 db or 2000 db,
anything else you will have to convert before sending.
5. if necessary, zip to under 2 MB. i have WinZip at this
end to unzip.
6. email to me at: ttaccess1 at yahoo dot com

if you prefer not, i'm afraid i can't think of how else to
help you; hopefully someone else in the newsgroups will
give you a good solution. good luck, and happy
holidays! :)
tina

-----Original Message-----
I have a form called POP form that uses data from a table
BnkPtnr Table. I want to be able to select the BnkPtnr #
(ID for bank partner) from a popup list in POP form and
have the corresponding BnkPtnr Name automatically appear
on the following field BnkPtnr Name (without having to
type it). BnkPtnr Table has two fields ID and Name. I
tried a dlookup function but this didn't work.
 

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