473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One or many

Hi friends, I am developing a project for an department in a school.
this school has some other sub-campus and each campus has different
rooms. ex.:
School XY:
sub-Campus 1:-Room1.1, Room 1.2, Room 1.3, Room 1.4, Room 1.4
sub-Campus 2:-Room2.1, Room2.2
sub-Campus 3:-Room3.1

I want to create a form that allow the user to select a sub-campus and
then automatically
the form shows the respective room for that campus. Ex.:
In a drop box: sub-campus 1
In another list box: will show the rooms for that specific campus.

Do I have to create for each sub-campus a table?
how can I design a form like this..
I want the result of this selection be saved in a table.

My second crazyness is that :How can I select more than 1 option at the
time in a combo box or list box or option group???

If someone gets this message, please write me back......
Thank you...

Jul 13 '06 #1
5 1276
NO, NO you do NOT want to create a separate table for each campus.

You want something like this:

tblCampus - Campus Table
ID - PK - autonumber
CampusName
other campus specific information

tblRooms Room Table
ID - PK - autonumber
CampusID - FK (The ID number of the Campus that this room is at)
RoomDesc
other room specific information (ie. max desks allowed - room color
- whatever)

With the above you can add a campus at any time and then add rooms to
that campus or any other campus at any time.

Ron

Jul 13 '06 #2
Ron2006 wrote:
NO, NO you do NOT want to create a separate table for each campus.
In addition to Ron's excellent advice, does each campus have one or more
buildings? In my facilities experience, it would be very odd to list
rooms and not buildings. The logical structure of such a system would
be to also have a buildings table:

tblRooms -tblBuildings -tblCampus

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Jul 13 '06 #3
Very good point Tim. Not having done one, I did not even think of
that.

The structures now change to be:
tblCampus - Campus Table
ID - PK - autonumber
CampusName
other campus specific information

tblBuilding - Building Table
ID - PK - autonumber
CampusID - FK (The ID number of the Campus where this building is
located.)
BuildingDesc
other building specific information.
Which would then change the tblRooms to be:

tblRooms Room Table
ID - PK - autonumber
BuildingID - FK (The ID number of the Building that this room is
at)
RoomDesc
other room specific information (ie. max desks allowed - room color

- whatever)

I hope you see the structure/concept that we are trying to derive.

Ron

Jul 13 '06 #4
Ron and Tim,, you are genious guys...
yes, for each campus are building and rooms numbers ex.:
campus name: main campus
Building: mmth
room#: 249

so, the total description would be:
main campus
mmth249
*for that specific room.

my problem is how to relate these 3 entities campus - building and room
in a way that a user-database administrator can input this data and
saved in a table (or 3 tables) throught a form AND after this create a
form for a final user be able to pick a campus and get auttomaticaly
the Buildings and Rooms (specific for that campus he just choose).

I hope could explain this ,

Again thank you guys..

Ron2006 wrote:
Very good point Tim. Not having done one, I did not even think of
that.

The structures now change to be:
tblCampus - Campus Table
ID - PK - autonumber
CampusName
other campus specific information

tblBuilding - Building Table
ID - PK - autonumber
CampusID - FK (The ID number of the Campus where this building is
located.)
BuildingDesc
other building specific information.
Which would then change the tblRooms to be:

tblRooms Room Table
ID - PK - autonumber
BuildingID - FK (The ID number of the Building that this room is
at)
RoomDesc
other room specific information (ie. max desks allowed - room color

- whatever)

I hope you see the structure/concept that we are trying to derive.

Ron
Jul 14 '06 #5
There are so many ways to skin this cat.

Way ONE.
1) Campus form bound to campus table (single form view)
2) subform on it bount to Building (with parent child relationship)
either single form or continuous form view.
3) Subform on the subform created in step 2 (can be single, continuous,
or datasheet vies) Again it will have parent child relationship)

Way TWO:
1) Unbound form, in single form view.
2) Combo box on that form with query of campus table
3) subform on this main form that is just like the subform in 2 above
except that its record source is a query with criteria of the selection
from the combo box.
4) subform on this subform that is identical to step 3 in Way ONE.

Way THREE:
1) Unbound form, in single form view.
2) Combo box on that form with query of campus table
3) Second combobox on that form with query of building table that is
based on a query that has criteria of combobox one just as step 3 in
Way TWO
4) Subform on this main form that is identical to step 3 of Way ONE
except that it is based on a query that has criteria of second combobox
on this main form.

Way one can allow easy addition of information into any of the tables.

Way two can allow easy addition of information into building and room
tables. This way will requiere the default value for the campus ID of
the buildingtable records to be the combobox of the main form.

Way three can allow addition of information into room table if desired
with special code in the default value of the buildingID field that
points to the value in the combobox 2 on this form.

This is just touching the surface. Hope it gives you some ideas. The
key here is to learn from the methods and let your imagination expand
the methods into other combinations of queries and default values.

Ron

Jul 14 '06 #6

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

Similar topics

8
1766
by: Greg | last post by:
Hello, I've to manage many 'table' (having same scheme) on the same server. And I ask myself what could be the best to do (and if you know, why) : Creating as many database (the name would...
3
1992
by: Mikey | last post by:
Hi all. In the process of trying to figure this thing out, I've been doing the old "stand around in the store and read as much as possible before you look like a derelict" thing. This time, with...
2
908
by: Keith | last post by:
I am having a problem creating a many-to-many-to-many type relationship. It works fine, but when I create a view to query it and test it, it does not generate the results I expected. Below...
5
447
by: oNLINE bUDDY | last post by:
How can you reverse a many-to-many XML structure between 2 tags? Lets say we have a books/author XML file. A book can have many authors. <book1> <Author1> </Author1> </book1>
2
2672
by: Megan | last post by:
hello everybody, i know this is a very long post, but i wanted to provide as much detail as possible. quick overview- i want to create a couple of many to many relationships and am wondering...
1
1886
by: Johnny Meredith | last post by:
Hi, I'm building a database that, once a year, generates surveys that are emailed to people in our organization. The recipients of the surveys are managers of various departments. The emails...
1
2593
by: Phil W | last post by:
Hello, I have set up my database in access using many to many relationships (it's the good ol' books and authors one again). I've actually extended it to include other people who contribute in...
13
1866
by: the other john | last post by:
The trouble currently with 3 tables. I'm excluding non-relevant fields... tbl_users PK_user_ID tbl_developers PK_developer_ID FK_developer_user_ID FK_developer_project_ID
1
2702
by: radiodave | last post by:
I don't know how to ask this question but I'll try: I'm making a database (Access 2003) for an Opera buff. I have tables related like: each Opera has many Productions (Madame Butterfly has an...
11
10603
by: RobertJohn | last post by:
Hi all I am using Access 2007 to start a small home library application, and so far it has two tables. 1. Books, with fields Book_ID (Primary Key) and Title, and 2. Authors, with fields...
0
7225
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,...
0
7326
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,...
0
7498
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...
0
5627
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,...
0
4707
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...
0
3194
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...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
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 ...
1
766
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.