View Poll Results: Would you be willing to provide help with this on msn fo me

Voters
2. You may not vote on this poll
  • Yes

    0 0%
  • No

    2 100.00%
Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2008
    Posts
    7

    Unanswered: Cascading List Box's x3



    I am a student studying ict and im currently working on an ict project

    i need help with cascading lis boxes i have included a copy of the data base in this msg so you can all see what im going on about

    Ive created the 3 list boxes on the form each list box has a custom name: Building, Room and computer in acordance to the corrisponding label on the form.

    I have 4 tables created. My IT teacher is not to shure on this either as i have a tendancy to go way over the top when it comes to project work so im like doing degree level data base stuff for this when actually its only BTEC First Level 2 lol

    any way i created the 4 tables: Building, Room, B101 and B103
    the relaitonships between them are one to many
    i started to create a query but im not entirley shure wether its required for the cascades or not lol so i gave up on the query and just left it in there.
    here is how the cascades should go

    Bradbury---->B101---->User 298
    User 297
    User 296
    User 294
    User 215
    Bradbury---->B103---->User 185

    If some one can explain to me how to do this, or alter the data base so it does this and then email it me i will be most grateful

    Thank you for Reading
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2007
    Posts
    70
    If i was doing this I would have two tables for the User numbers. One with the Users for B101 and one for the Users for B103. Then you could use a bit of VB to make the 3rd combo box select the table required based on the selection in the second combo box (B101 or B103).

  3. #3
    Join Date
    Feb 2008
    Posts
    7

    thanks for replying

    Quote Originally Posted by OB1
    If i was doing this I would have two tables for the User numbers. One with the Users for B101 and one for the Users for B103. Then you could use a bit of VB to make the 3rd combo box select the table required based on the selection in the second combo box (B101 or B103).
    yea thats what i done if you look at the attached database there are 2 tables labeld B101 and B103 but i am no good at vb

    i been researching this on the net for a while and it mentions about afterupdate.requery but i dont know how to implement it for the list boxes in accsess

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by OB1
    If i was doing this I would have two tables for the User numbers. One with the Users for B101 and one for the Users for B103. Then you could use a bit of VB to make the 3rd combo box select the table required based on the selection in the second combo box (B101 or B103).
    nasty nasty nasty, doesn't feel right at all.

    why would you have a separate table for B101 or B104
    could a user use a computer in either room, if so that design would suggest you would be duplicating users based on rooms.

    presumably the requirement for the assessment is what 4 tables to do computer room bookings

    presumably a room is an attribute of a building
    presumably a computer is an attribute of a room, ie a computer cannot be in more that one room concurrently, obviously laptops can move, but desktops shouldn't.
    presumably a user can book any computer in any room, but can't book more than one computer for any one time slot.
    presumably there will be some business rule which limits the number fo times a user can book a computer for a continuous sessions (say they can use a computer for 2 hours max, and then require at least a 1 hour break.

    incidentally If I were you I'd be using relationships which enforced relational integrity. if you don't then in my books theres near stuff all point in using a relational db like Access/JET.. you might as well use a flat file system

    so I suppose the real question is do you think your datra model supports the business roles its trying to model

    do you think there are misisng tables

    I don't understand what tables B101 & B103 represent as entities... but Ive a suspisicion that they are redundant, there probably shoudl be a single table which identifies which computers are in which room

    I think you are probably missing a table for users, and a table which associates a user with a computer to generate a computer booking.

    but as you point out that may be too much for the assignment. perhaps the first step is to revisit what the assignment is, and then work out if the design you are developing is appropraite to that assignement.


    if the assignment is to generate a form with 3 linked list boxes, then I'm not sure what you have doen so far actually meets that requirement.

    the detial of a triple linked list boxx is realtively trivial once you have identified your datasource.

    one of the 'toys' I tinkered with a while ago examined the system tables collections.. it allowed a user to identify the object types in on list box (say tabels, queries, reports etc...).
    selecting the object type then displayed the objects of that type in list box 2
    selecting that specific object in list box2 then displayed the properties of that specific object in lost box 2.. ie you could specify I want to look at tables, select a table, and then display all columns & indices in a 3rd listbox.... th toy had a 4th list box whihc then displayed all the properties for each column or index for the selected item in list box 4.

    an advantage of that approach is that you are using data that pre-exists in an Access db, so you are bot creating an artificla data construct which may fall apart if examined too closely.. but whether thats a candiate for your assignment is beyond me.. I'd certainly ssuspect it may be beyond your capabilities right now.. but if you don't stretch yourself y'never know.

    I do find the comment that your teacher doesn't know either truly scary.....

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    The detail of the list box is to put some code behind the listboxes on click event that forces a requery of another list box, or changes that list boxes recordset/source

    eg
    listbox2.rowsource="Select * from mytable where mycolumn=blah"
    listbox2.requery

  6. #6
    Join Date
    Feb 2008
    Posts
    7

    thanks for replying

    in the tables B101 and B103 the word user refers to the computer name
    at the college here all the computers have a unified syntax for a computer name its always domain(cant say that part lol)/userxxx(xxx being whatever user number the computer is)
    Tables B101 and B103 reprisent rooms B101 corisponding to Room B101 B= Bradbury wich is the name of the building and the same for B103
    The database in its current state is just a sample for the project but until get my head round cascades there is no point in adding the other buildings' room's and computer's to the database
    the aim of the project is to set up a help desk system.

    With the refirential integrity my it teacher dosent think i need it enforced. Personly i think it should be but when i tried to enfource it, access just gave me some error msg


    Quote Originally Posted by healdem
    nasty nasty nasty, doesn't feel right at all.

    why would you have a separate table for B101 or B104
    could a user use a computer in either room, if so that design would suggest you would be duplicating users based on rooms.

    presumably the requirement for the assessment is what 4 tables to do computer room bookings

    presumably a room is an attribute of a building
    presumably a computer is an attribute of a room, ie a computer cannot be in more that one room concurrently, obviously laptops can move, but desktops shouldn't.
    presumably a user can book any computer in any room, but can't book more than one computer for any one time slot.
    presumably there will be some business rule which limits the number fo times a user can book a computer for a continuous sessions (say they can use a computer for 2 hours max, and then require at least a 1 hour break.

    incidentally If I were you I'd be using relationships which enforced relational integrity. if you don't then in my books theres near stuff all point in using a relational db like Access/JET.. you might as well use a flat file system

    so I suppose the real question is do you think your datra model supports the business roles its trying to model

    do you think there are misisng tables

    I don't understand what tables B101 & B103 represent as entities... but Ive a suspisicion that they are redundant, there probably shoudl be a single table which identifies which computers are in which room

    I think you are probably missing a table for users, and a table which associates a user with a computer to generate a computer booking.

    but as you point out that may be too much for the assignment. perhaps the first step is to revisit what the assignment is, and then work out if the design you are developing is appropraite to that assignement.


    if the assignment is to generate a form with 3 linked list boxes, then I'm not sure what you have doen so far actually meets that requirement.

    the detial of a triple linked list boxx is realtively trivial once you have identified your datasource.

    one of the 'toys' I tinkered with a while ago examined the system tables collections.. it allowed a user to identify the object types in on list box (say tabels, queries, reports etc...).
    selecting the object type then displayed the objects of that type in list box 2
    selecting that specific object in list box2 then displayed the properties of that specific object in lost box 2.. ie you could specify I want to look at tables, select a table, and then display all columns & indices in a 3rd listbox.... th toy had a 4th list box whihc then displayed all the properties for each column or index for the selected item in list box 4.

    an advantage of that approach is that you are using data that pre-exists in an Access db, so you are bot creating an artificla data construct which may fall apart if examined too closely.. but whether thats a candiate for your assignment is beyond me.. I'd certainly ssuspect it may be beyond your capabilities right now.. but if you don't stretch yourself y'never know.

    I do find the comment that your teacher doesn't know either truly scary.....

  7. #7
    Join Date
    Feb 2008
    Posts
    7

    Question thanks for replying

    Quote Originally Posted by healdem
    The detail of the list box is to put some code behind the listboxes on click event that forces a requery of another list box, or changes that list boxes recordset/source

    eg
    listbox2.rowsource="Select * from mytable where mycolumn=blah"
    listbox2.requery
    am i correct in assuming that tbl would be the vb tag to indicate the table name
    what would indicate the colum

  8. #8
    Join Date
    Feb 2008
    Posts
    7
    I dont think i done this right

    this is the vb thats currently in the (vb what ever you call it) thingy for the list box names Room

    Option Compare Database

    listbox2.RowSource = "1 * from tblRoom where mycolumn=RoomID"
    listbox2.Requery

    listbox2.RowSource = "1 * from TblB101 where mycolumn=Computer Name"
    listbox2.Requery

    listbox2.RowSource = "3 * from TblB103 where mycolumn=Computer Name"
    listbox2.Requery

    Private Sub Room_BeforeUpdate(Cancel As Integer)

    End Sub

  9. #9
    Join Date
    Feb 2008
    Posts
    7

    just a thought

    can xml be used as the data src as i created an xml doc that contains all the rooms and corisponding computers for the bradbury and karten

    however i dont actually know xml i built up the doc based on what i know of html and some research i did in to xml

    see atatched zip (wich also contains updated vershion of database
    Attached Files Attached Files

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by darkdj
    i have a tendancy to go way over the top when it comes to project work
    Quote Originally Posted by darkdj
    can xml be used as the data src
    Over the top you say?
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •