473,692 Members | 2,034 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 1907
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
2313
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 allow a user to add a new entry to a drop down box that had been dynamically populated from an...
1
1547
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
3100
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
6154
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 they pull down the items from the drop down list.
2
12615
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 box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
5
4224
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
1724
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 and LastName which are entered in my data capture form which works fine. The problem
1
6464
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 Animals, Birds... If i select the Animal option, the second drop down list should show like Lion,...
3
1174
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 SubjectCode, along with a Data View setup.
8
24797
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. What I want it to do is use the "Course_Name" as its drop down list but store the associated...
0
8603
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8538
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8797
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8800
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7627
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4323
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1957
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.