Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

Lookup Drop down not populating table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jen Preston - 03 May 2005 18:37 GMT
I have a form based on a query.  On this form is a drop down to lookup
companyname on a master table that is different from the query.  The query
updates my main table, but the drop down of companyname is not populating
the table.

I tried to join the master table to my query, but that just makes the query
NOT updatable.  I'm thinking there must be code to move the company name
after the update of the drop-down to the query field.

Can anyone help me with this??
Thanks,
Jen
Jen Preston - 03 May 2005 18:57 GMT
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??
tina - 03 May 2005 19:16 GMT
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...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.