Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2007
    Posts
    13

    Unanswered: MS Access Database help

    Hello everyone. New member here. I am in charge of a database at the college where I attend classes. This database is a student sign in/out involving two forms. The first form has a list box that displays students who are currently signed in but have not yet signed out. When the student is ready to sign out the need to be able to select their name from the list, click on the sign out button and have their name come up into the name fields on the second form. I hope someone can help. Thanks in advance.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Welcome to the forums!
    Oooh you know what - I built something which had this functionality during my A Level course - I'll see if I can dig out some sample code when I'm home.

    EDIT: I assume this is MS Access related?
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2007
    Posts
    13
    That would be great thanks
    Yes you assume correctly. (Access 2003)
    Last edited by frankl; 09-06-07 at 20:55.

  4. #4
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    Some more information would be helpful.

    What is the data source for the list? Is it a query from a table of students, a temporary table generated on the login, something else?

    What is the second form? What is the data source for that list.

    ---

    What you are looking to do is pretty straight forward, how to go about it would depend somewhat on how the list is populated.

    The login routine must have some component to flag a user as being currently logged in and added to the list of logged in students. The logout routine would just need to do the opposite of this and then refresh the list.

    Steve

  5. #5
    Join Date
    Sep 2007
    Posts
    13
    The data source is a query that simply displays the the students that have not signed out. When a student types in their name and clicks the sign in button their info is updated to the "StudentTable". Their name will also appear in the list box until they sign out. The second form is the sign out form. This form has roughly the same fields that the first form has, (first/last name, date etc.) along with other options to select. When the student is at the sign out form they must scroll to find there name. If they have visited the center more than once they my select the wrong instance of their name and not be add to the table correctly. Since the list box only displays the students who have not yet logged out, it would be nice if they could just select thier name from the list, click the sign out button and have the name fields automatically populated with that instance of their name. Hope that clarifies things. thanks

  6. #6
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    Without seeing the system it is hard to give any good answers. It sounds like there might be a design issue. In theory what you are doing is quite simple.

    Without knowing all the details I would expect the system to have a table of students and a second table to track the activity with a field that would get updated when the student logs out.

    Basically all that form would need to do is select the student name from the list which will tie back to the student's id in the database. Then update the activity table, set all open logins to logged out where student id is the student selected.

    From there just query the tables to pull the data you want to see and set the appropriate list boxes to those results.

    Steve

  7. #7
    Join Date
    Sep 2007
    Posts
    13
    Theres only one table, The StudentTable. All student activity gets updated to that table. I am not very adept at this kind of thing. I have had a basic database class and these people think that I am an expert at this sort of thing. I am going to try to upload the database so that you can see it. Any help that you can give would be apprieciated. Thanks
    Attached Files Attached Files

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Frankl, don't worry - I haven't forgotten about this - I just haven't had time to dig out the example
    UPDATE: Threads merged, moved and dupes removed
    Last edited by gvee; 09-07-07 at 10:44.
    George
    Home | Blog

  9. #9
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    Since there is only one table I will make the assumption that you are not storing the history of their logins. (if you are then you need to split the tables) I would question the reason behind a database application for logging students in and out that doesn't really appear to do anything but just to keep things really simple I will assume your table has three fields, studentId, studentName and a boolean for loggedIn. Given that scenario the login list would list the students while hiding their id, the logout form would display a list of students where loggedIn = true and then on logout it would UPDATE the student table and SET loggedIn = false WHERE studentId = cboStudent. After a requery of the list the student would be removed or added as requested. Try out a few things, it really is a great way to learn sometimes.

    Steve

  10. #10
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by frankl
    Theres only one table, The StudentTable. All student activity gets updated to that table. I am not very adept at this kind of thing. I have had a basic database class and these people think that I am an expert at this sort of thing. I am going to try to upload the database so that you can see it. Any help that you can give would be apprieciated. Thanks
    Hi Frankl,

    I just viewed your database an with just my opinion you need to redesign it. Right off the bat I can see where 3 tables could be used: Students, Courses, Resources. Also, I noticed that you actually used each students' name in the Table as a Field itself. To me that really isn't a good way to do it.
    Next, when I was on the Sign Out form and tried to SignOut by clicking the CommandButton it popped up a message: Please select at least one course. I had one selected, but it actually only works if you select 2 courses...well at random. Also, the LastName is not pulling over onto this form.
    Next, your SignIn form. When it first opens there are names already there. Your instructions are to First, input your name and Then click the New Record CommandButton. If you break down the Tables individually, create a ComboBox to select names After they have already signed in, that would be nice.
    When they first get to the sign-in form, have it open Blank so that they can fill in their names. Someone who is not fluent in Access won't know to click the asterisk to create a new record. One other thing after you create your three tables is to set up the relationships for them as well. That will all be a good starting point for you. There are possibly many numbers of good ways to do this, I just gave you something off the top of my sleepy head. For now heading to bed. Night all.....yawn.....

    btw, there are many very good books to give you the basics on Database design and some links here in the forum as well. Might do you a world of good to check into them to get things good from square one. Even if you didn't design the database yourself, it should be easy enough to redesign it at this point still.

  11. #11
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Here you go Frankl, I knew I had something knocking about somewhere!

    Please, please, please ask if you don't understand andy of the code - I'm more than happy to explain it to you.
    Attached Files Attached Files
    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
  •