Solved

How do I create Access 2007 dynamic Combo Box

Posted on 2011-02-26
6
564 Views
Last Modified: 2012-08-13
I have a Table "Mojo"  fields Dept, SampleType and Sample.  Table "Dept" fields: Dept and DeptDesc.  Table "SampleType" fields: SampleType and SampleTypeDesc.  Table "SampleInfo" Fields: SampleName, SampleType, Dept.  Access 2007 is front end and SQL server 2005 back end.  I created a Form Mojo with a Combo Box for Dept that would select Dept and Combo Box for Sample Type to select Sample Type and I want to create a Combo box that would display SampleName field from SampeInfo table to feed into Sample Field of Mojo table.  How can I do this?
0
Comment
Question by:dpawar
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:tabish
Comment Utility
Do you want to create a combo box on the fly or you just want to populate it based on sampletype selected in the " Sample Type " Combo box?
0
 
LVL 4

Expert Comment

by:tabish
Comment Utility
You can use the following to populate the ComboSampleInfo (under row source property: ComboSampleInfo -> Properties -> data -> Row Source)

SELECT SampleInfo.[SampleNamed] FROM SampleInfo WHERE (((SampleInfo.SampleType)=[forms].[form1].[comboSampleType]));
 
0
 

Author Comment

by:dpawar
Comment Utility
Based on Sample Type
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:dpawar
Comment Utility
Thanks.
How do I do it based on SampleType and Dept combo boxes?
0
 
LVL 4

Accepted Solution

by:
tabish earned 500 total points
Comment Utility
IN Table "SampleType" fields: SampleType and SampleTypeDesc.  
AND
Table "SampleInfo" Fields: SampleName, SampleType,

Field "SampleType" is common. Means table seemed to be linked. where as Table Dept does not seemed to be linked to either of the above tables. So comboSampleInfo cannot be based upon dept unless you introduce a new field something like deptID etc in may be sampleType table.

It means a dept will have one or mare SampleTypes and SampleTypes will have one or more SampleNames.

The Table Structure at present is:
Dept is stand alone (not linked to any of the table)
SampleTypes can have one or more SampleNames (SampleTypes is linked to SampleInfo  one-to-many relationship)

Sorry if it is a bit confusing.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
Comment Utility
Can you post a screen shot of your Relationships diagram?
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now