On Fri, 2 Jul 2010 13:22:13 -0700 (PDT), Wayne <(E-Mail Removed)> wrote:
>Combo's Control Name = cboCustomerName
>Column Count = 5 (there are about 15 fields but just working with the
>first 5 for now)
>Column Widths = 1";0";0";0";0"
>Combo's Row Sourse = qryCustomerAddress (query)
>
>Autofill fields using formula in each of the 5 Control Source fields
>like this: =[cboCustomerName].Column(4)
>
>The autofill works good but always fills with first record found if
>the CustomerName is the same.
Of course. It's filling in the value that you selected from the combo box.
If the rowsource for the combo box has
VONS Market
VONS Market
VONS Market
VONS Market
VONS Market
how can you possibly expect Access to magically guess which of the five you
want??? Does your table have a unique MarketID?
>I need a unique name in the combo field so I get the correct address
>like above - VONS Market(8). I could write VBA code to search for the
>last entry for example:VONS Market(XX) but that seems to be a pain.
>Is there an easier way?
I'm still not clear on your table structure, but I'd be inclined to use a
table with field such as MarketID, MarketName, City, Address - displaying the
latter three, so you would see
VONS Market; Pasadena; 2355 E. Colorado Blvd.
VONS Market; Pasadena; 1390 N. Allen Ave.
The bound column would be the unique MarketID (not the market name), and the
user would be able to select the specific market they intend, rather than
blindly taking the first.
To respond to your later message today, if you're using this combo to *LOCATE*
or display an existing record, rather than to update an existing record, then
it must be unbound - nothing in its Control Source - and you'll need either a
macro or code in its AfterUpdate event to jump to the selected record. What's
the Recordsource for your form? What's the Rowsource of the combo?
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also
http://www.utteraccess.com