473,842 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting a range of records in a combobox with another combobox

I have a combobox which is used to select records, which is
satisfactory at the moment.

However, a second user is going to start using this database and there
will be 1600 records. This makes the combobox a little unfeasable as
searching through this many names would be difficult and
time-consuming.

I would like the user to be able to select a group of people from a
first combobox, and then when he goes to the second, only the names of
these people are displayed.

If anybody can point me in the right direction, I'd be grateful.
Thanks.
Nov 12 '05 #1
3 2646
How are they grouped?

Phil

"Pete" <pg*******@yaho o.co.uk> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
I have a combobox which is used to select records, which is
satisfactory at the moment.

However, a second user is going to start using this database and there
will be 1600 records. This makes the combobox a little unfeasable as
searching through this many names would be difficult and
time-consuming.

I would like the user to be able to select a group of people from a
first combobox, and then when he goes to the second, only the names of
these people are displayed.

If anybody can point me in the right direction, I'd be grateful.
Thanks.

Nov 12 '05 #2
Basically, its for a school. The pupils are divided into forms, 7F1,
7F2, 8F1, 8F2, etc, with five years (the 7,8,9,10 and 11) and ten
forms in each year F1 to 10).

What I want to be able to do is select 7,8,9,10 or 11 from one
combobox and then in the second combobox see only the pupils in that
particular year group, if anyone can help...???

I've tried a few different methods but with no success so far - I'm
not so experienced in coding.

Thanks.
"Phil Stanton" <ph**@stantonfa mily.co.uk> wrote in message news:<3f******* *************** *@mercury.nildr am.net>...
How are they grouped?

Phil

"Pete" <pg*******@yaho o.co.uk> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
I have a combobox which is used to select records, which is
satisfactory at the moment.

However, a second user is going to start using this database and there
will be 1600 records. This makes the combobox a little unfeasable as
searching through this many names would be difficult and
time-consuming.

I would like the user to be able to select a group of people from a
first combobox, and then when he goes to the second, only the names of
these people are displayed.

If anybody can point me in the right direction, I'd be grateful.
Thanks.

Nov 12 '05 #3
OK Pete

Lets assume you have done the thing logically and have 2 tables

Table Pupils
PupilID Autonumber Key
PupilName Text ' though you shold have surname and first name in
separate fields
.....
.....
FormID Long Number Required

and

Table Classes ' Don't use "Form" it will get
muddled with an Access Form
ClassID Autonumber Key
Class Text Indexed No Duplicates

Relationship between the 2 ClassIDs

You then have a form based on the Pupil Table (or query) with 2 combo boxes
for searching + 1 Combo box for changing the Pupils Class.
I assume it also has PupilID, PupilName and Class on it

The first ComboBox is for inputing the class for the pupil
Name ClassID
ControlSource ClassID
RowSource "SELECT Class, Class FROM Classes ORDER BY Class;"
ColumnCount 2
ColumnWidths 2cm;0cm
BoundColumn 2

The first ComboBox for finding the pupil, which class
Name ClassIDRelay
ControlSource
RowSource "SELECT Class, ClassFROM Classes ORDER BY Class;"
ColumnCount 2
ColumnWidths 2cm;0cm
BoundColumn 2

The Second ComboBox for finding the pupil having entereg the class in
ClassIDRelay
Name PupilRelay
ControlSource
RowSource "SELECT Pupils.PupilNam e, Classes.ClassID , Pupils.PupilID
FROM Pupils INNER JOIN Classes ON Pupils.ClassID = Classes.ClassID
WHERE (((Classes.Clas sID)=[forms]![Pupils]![ClassIDRelay]))
ORDER BY Pupils.PupilNam e;;"
ColumnCount 3
ColumnWidths 4cm;2cm;0cm
BoundColumn 3

Ok I know that sound a bit complicated. Now unfortunately you need a few
lines of code.

After you change the ClassIDRelay, you need to get fresh information into
the PupilRelayCombo box.

So in the ClassIDRelay properties tab, under After Update just key in a [ -
yes a square bracket and it will change to [Event Procedure]
At the right hand side of the line will be ... (3 dots). Click on them and
you are in Visual basic
It should already say
Private Sub ClassIDRelay_Af terUpdate()

End Sub

Type in in between the 2 lines ClassIDRelay.Re query so that it looks like
bthis

Private Sub ClassIDRelay_Af terUpdate()

RupilRelay.Requ ery

End Sub

That will get your second combo box with the pupils from the selected class
showing in order

Nearly there. I could have written the whole thing faster than writing this
reply

Now type in a similar thing on the After update of the PupilIDRelay to get

Private Sub PupilIDRelay_Af terUpdate()

DoCmd.GoToContr ol "PupilID"
DoCmd.FindRecor d PupilIDRelay

End Sub

Hope this helps

Phil
"Pete" <pg*******@yaho o.co.uk> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
Basically, its for a school. The pupils are divided into forms, 7F1,
7F2, 8F1, 8F2, etc, with five years (the 7,8,9,10 and 11) and ten
forms in each year F1 to 10).

What I want to be able to do is select 7,8,9,10 or 11 from one
combobox and then in the second combobox see only the pupils in that
particular year group, if anyone can help...???

I've tried a few different methods but with no success so far - I'm
not so experienced in coding.

Thanks.
"Phil Stanton" <ph**@stantonfa mily.co.uk> wrote in message

news:<3f******* *************** *@mercury.nildr am.net>...
How are they grouped?

Phil

"Pete" <pg*******@yaho o.co.uk> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
I have a combobox which is used to select records, which is
satisfactory at the moment.

However, a second user is going to start using this database and there
will be 1600 records. This makes the combobox a little unfeasable as
searching through this many names would be difficult and
time-consuming.

I would like the user to be able to select a group of people from a
first combobox, and then when he goes to the second, only the names of
these people are displayed.

If anybody can point me in the right direction, I'd be grateful.
Thanks.

Nov 12 '05 #4

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

Similar topics

2
3198
by: Tony Williams | last post by:
I have two tables one lists the names of committees and the other is a list of documents they generate. I have a form based on the documents table which gives details of the document including which committee generated it. On the form I also want to indicate which other committees are interested in that document, there could be 1 or say 8, it differs for each document. I had thought of creating say 10 combo boxes based on the committee...
4
4492
by: Roger Aikin | last post by:
I've converted a VB6 project to VB.Net 2005. (Actually using vstudio pro 2005). I'm on a machine that also has VB6 and Vstudio.net 2003 on it. The project uses Word, Excel, MapPoint and SqlClient (database is SqlServer 2000). OS is WinXP SP2. When I run the project, it opens the MDI form (MdiMain.vb) fine, but when I open one of the child forms and try to select something in a combo box (cboFilter2) it stops on a line of the...
3
1892
by: Georges Heinesch | last post by:
Hi. I have a ComboBox in a table (tbl1), which is populated by another table (tbl2). The ComboBox "Row Source Type" is set to "Table/Query", and the "Row Source" is set to "tbl2". In this configuration, the records of tbl2 in are not ordered as desired in the ComboBox field of tbl1. Can I order the records in ComboBox somehow, without using a query as "Row Source" to order the records?
1
1410
by: Harry | last post by:
I have two tables in a database. One fills the drop-down and the other records the selection. Filling the dropdown with another table seems to be breaking the binding with the table it records to. VS2005 with SQL2005. I have a lot of these to do, and don't want to hard code each box. I can drop and drag the table elements to the form and they work fine, however, as textboxes. I want to add dropdown boxes populated by another table....
4
5118
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I have to load 30,000 unique names into a combox. Filling a dataTable takes only a few milliseconds. But populating the combobox and displaying the list takes several seconds - way too long. A user selects a name from the combobox and runs a query. Originally, this combox was on a form in an MS Access ADP which was linked directly to our sql server. The combobox populated withins millisecnods. How can I achieve this...
2
2609
by: movieking81 | last post by:
If someone could help me with this, that would be great. I need to select a number of records from an SQL table based on a date range, so I started with this select. <html> <code> resultssql = "SELECT * FROM testtable where name = '" & request("name") & "' AND fromd >= '" & getdatefrom & "' AND fromd <= '" & getdateto & "'" </code> </html> This select does find records, however they are not the correct ones. The records it finds only...
4
3621
by: Eugene Anthony | last post by:
I have a table that has a DateTime column which uses a DataTime datatype. How do I retrieve a range of records based on the month and year using ms sql? Eugene Anthony *** Sent via Developersdex http://www.developersdex.com ***
5
2895
by: megahurtz | last post by:
I need to put together an SQL statement and I can't think of how to make it work properly. The scenario is that I have news items in a database that have a launch time and can optionally have an expire time set. I want to select all records that are above the launch time and below their expire time (if it is set). What I have so far is: $rightnow = mktime(); SELECT * FROM teamshadow_news WHERE (launch_time <= $rightnow AND expire_time =...
0
3525
by: drfish | last post by:
Hi, I'm a complete novice when it comes to VB so need some help. I would like a macro that performs linear regression for different cell ranges each time it is run, depending on the number of contiguous cells in the columns. I have managed to recorded a macro in Excel to perform a linear regression using the Data Analysis Toolpak for a fixed cell range: Sub Macro5() ' ' Macro5 Macro ' Macro recorded 15/09/2008
0
9875
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
9715
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,...
0
10317
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
9454
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...
1
7859
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7040
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5886
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4500
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
2
4090
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.