Solved

How do I create Access 2007 dynamic Combo Box

Posted on 2011-02-26
6
567 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
Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

756 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