Okay. I see that when I switch the bound column from the companyid to the
companyName, the company name will populate the table but now NOT the
companyid.
Is there a way to bound more than one column??
so you have a table with a list of companies, which you use to populate a
combo box droplist. the pertinent fields in tblCompanies are CompanyID and
CompanyName. so far correct? presumably CompanyID is the primary key field
in this table.
you have another table, your main table, that should have a field in it for
CompanyID. this is a foreign key field, meaning it matches the primary key
field in tblCompanies.
if you don't have your tables set up as above, you probably should. the
CompanyID field in both tables must have the same Data Type. if the primary
key field is AutoNumber, then the other field's data type must be Number,
wotj Field Size as Long Integer.
now, go to your data entry form. the combo box's ControlSource should be the
CompanyID field (whatever you named it) from your main table query. in the
combo box's RowSource, you should have at least two fields: CompanyID and
CompanyName. make sure that CompanyID is the bound column. in the
ColumnWidths property, set the width of the CompanyID column to 0". for
instance, say your RowSource is
SELECT CompanyID, CompanyName FROM tblCompanies ORDER BY CompanyName;
then your ColumnWidths property would be set to
0"; 1.5"
now your droplist will show the company names, but the value that is saved
in the main table is the CompanyID, which is correct.
hth
> Okay. I see that when I switch the bound column from the companyid to the
> companyName, the company name will populate the table but now NOT the
> companyid.
>
> Is there a way to bound more than one column??
Jen Preston - 03 May 2005 19:23 GMT
Hi Tina,
Thanks for the feedback. My problem is that the companyid is populating,
but NOT the Company Name. Is there a way to populate BOTH the company id
and the company id from the drop down.
Thanks!!
Jen
Amit - 03 May 2005 21:38 GMT
> Hi Tina,
> Thanks for the feedback. My problem is that the companyid is populating,
[quoted text clipped - 3 lines]
> Thanks!!
> Jen
Hi Jen,
I had a similar issue, and here is the link for the solution from these
awesome MVPs :
http://support.microsoft.com/newsgroups/newsReader.aspx?dg=microsoft.public.acce
ss.formscoding&tid=6b6706a5-829b-4dd1-9109-7dc551e96b65&cat=en_US_2b7c2ef5-14f9-
4851-a263-979912902128&lang=en&cr=US&sloc=en-us&m=1&p=1
Hope this helps.
-Amit
Jen Preston - 03 May 2005 22:07 GMT
Thank you Amit!! That worked for me. Thanks again...