473,614 Members | 2,342 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 2627
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
3189
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
4477
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
1886
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
1403
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
5099
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
2596
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
3613
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
2883
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
3514
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
8640
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8443
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
7114
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
6093
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
4058
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...
1
2573
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
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
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.