473,566 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access 2nd drop down list help

I need some help! I'm trying to set up two drop down menus where the
first displays the Department and the second displays the names of the
printers found in the department.

So far i have two tables, one called tbldepartment and the other
called tblname. Tbl department has 2 fields in it which are ID and
department name(i've set ID to autonumber and it is the primary key).
Tbl name also has two fields in it which are IDTab and name(ID Tab is
the primary key and is not autonumber) .

The problem is i'm getting the first drop down list displaying ok but
the second shows all the printer names instead of the ones related to
the department. I thought if i put some code in the On click field in
the first listbox to tell it to go to the Tbl name and select the
printername with the matching id to the department table then my table
would work!

Only problem is i don't know how to go about the visual basic code
that is required.
Does anyone know how to do this? I'm stuck :-(

Jun 24 '07 #1
2 1905
For the second drop down you need to create a query linking the
Department table with the Printer table.
On this query, you need to have the first drop down (Department combo)
as a criteria for the field 'Department'.
Say your form is called 'Department Printers' and your drop down for
Department is called 'combo0' then your criteria should be something
like [Forms]![Department Printers]![combo0].
This way, every time you invoke the Printer drop down, it will narrow
the results to the department you have selected in the Department drop
down.

HTH - Max

Jun 24 '07 #2
the contents of the second combo box's droplist will not change
*automatically* when the value in the first combo box changes, though. add a
macro or VBA procedure to the first combo box's AfterUpdate event, as

Me!SecondCombob oxName.Requery

if the form is used to display existing records as well as to enter new
records, add the same macro or VBA procedure to the form's Current event,
too.

hth
"Max Vit" <mv**@safe-mail.netwrote in message
news:11******** **************@ i13g2000prf.goo glegroups.com.. .
For the second drop down you need to create a query linking the
Department table with the Printer table.
On this query, you need to have the first drop down (Department combo)
as a criteria for the field 'Department'.
Say your form is called 'Department Printers' and your drop down for
Department is called 'combo0' then your criteria should be something
like [Forms]![Department Printers]![combo0].
This way, every time you invoke the Printer drop down, it will narrow
the results to the department you have selected in the Department drop
down.

HTH - Max

Jun 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2306
by: jason | last post by:
Is there a way - possibly a disconnected rs? - to update the contents of an existing pulldown on a page without having to re-submit the page for the user to see the pulldown populated with an additional value? I realise there are javascript possibilities (and I am still searching for a usable one) but I thought perhaps it may be possible to...
1
1543
by: jcombalicer | last post by:
How will you make a drop down list that rely information from another drop down list with the help of row source, sql and query not with the of form, pages and vba. Every department has different designation and every designation has different section..... Thank You!
14
3083
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ; ExpenseType Data: 1 ; FOOD 2 ; AIRLINE 3 ; FARE
3
6144
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box that appear when user clicks the drop-down arrow button. Because items in the Drop down list are a little long, user can't see the full thing when...
2
12600
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list...
5
4212
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1); System.Data.SqlClient.SqlCommand dbCommand1 = new System.Data.SqlClient.SqlCommand();
9
1719
by: thebison | last post by:
Hi all, I hope someone can help with this relatively simple problem. I am building a timesheet application using ASP.NET C# with Visual Studio 2003.As it is only a protoype application, my database has been made in MSDE. As part of my application, I have a 'Resources' table, which holds employee information. I have the fields FirstName...
1
6456
by: ashok893 | last post by:
I'm using two drop down list in a form. I have generated the first drop down list from MySQL database with the help of PHP. When i select an option from first drop down list, i have to generate second drop down list options by the selected value of first drop down list from MySQL database. For example, the first drop down list contains...
3
1164
by: GeekyChicky79 | last post by:
Hi Everyone, I have the project below where I'm pulling out information from 1 table "Subjects", pulling the Subjects, and SubjectCode. The Subjects are displaying in the Combo Box just fine, but I can not get the corresponding Subject Code to display in the Label. I have 2 Data adapters/dataset,1 for Subjects, and the other for...
8
24784
by: gurmet | last post by:
I have two tables; 1. Called "Courses" that contains two fields "Course ID" and "Course Name". 2. Called "Sessions" that contains a field called "Course ID". Then I have a form with a combo box that uses the "Course_Name" field for its list and stores the item you select from that list into the "Course ID" field on the "Sessions" table....
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.