Solved

How do I create Access 2007 dynamic Combo Box

Posted on 2011-02-26
6
569 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:tabish
ID: 34987732
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
ID: 34987795
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
ID: 34987844
Based on Sample Type
0
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

Author Comment

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

Accepted Solution

by:
tabish earned 500 total points
ID: 34988125
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
ID: 34988137
Can you post a screen shot of your Relationships diagram?
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2010 Form - Turn Updating On - Off 31 89
Error 438 6 45
Create a varying recordset 5 45
Microsoft Access 32-bit or 64-bit? 11 49
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…

734 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