Results 1 to 3 of 3
  1. #1
    ainyancat is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    1

    Question Combo boxes (Student database)


    Views: 18 Size: 203.5 KB">university_updated.zip
    university_updated.zip

    Hello everyone,

    I would like you to help me with a small h/w of the course "managing information systems"

    Here's the task itself
    "Create a form that will allow easily register students for courses with two combo boxes. One combo box will display the information about a student (studentID, Last name, First Name), the other one will display information about the course (catalogNum, Title, Section). The first combo box must take information from the Students table but record the information into StudentsTakesCourses table. The second combo box must take information from the query created earlier but record the information into the StudetTakesCourse table."

    I am also attaching the zipped access file.

    Generally, we need to create a form with two combo boxes, that will allow us to register students and it should be shown in the table called "StudentsTakingCourses". Even though I made two comboboxes based on the tables written in the task, when I change the info on the form, the info on the table does not change.

    Maybe I need to create a new query, or make some sort of a relationship between two boxes?

    Looking forward for your help.
    Best regards,
    Aizada

  2. #2
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370

    Lightbulb

    No relationship is needed. You are correct in the sense that you have to make a query. You will need to make an append query that: gets the frmRegister student combobox value and gets the frmRegister Course value and then appends to your table "StudentTakingCourses."

    EDIT:

    I've opened your DB, and you have the first part right. You have a form with two comboboxes that are pulling the correct information.

    Things you will need to do:
    1. Add a blank textbox to your form, set the control source of this textbox to your combobox's catalog number. You need to look this up since this is your homework assignment... HINT: Column reference.
    2. You can hide this new text box if you would like to so it isn't showing anything in the live form.
    3. Create an append query that appends to your table.....StudentTakingCourses.
    4. in this query you will reference combobox2 for the first field in the query, the second field in the query will reference your textbox that we created in step 1.
    5. change your "append to" to the correct fields.
    6. Add a button on form that runs your new query.
    7. All done.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would suggest you need some work on your table structures.
    Click image for larger version. 

Name:	relation1.jpg 
Views:	9 
Size:	40.4 KB 
ID:	29212
    There are a LOT of duplicated fields in two tables.
    "Time" is a reserved word in Access and shouldn't be used as an object name.
    Note that I renamed the StudentID fields.....


    I would design the form a little differently.
    The main form would be based on a query on the Students table. The detail section would have the fields in continuous forms view.

    In the main form footer would be a sub form based on a query of the StudentTakingCourses table.
    The main/sub forms are linked on StudentID_PK and StudentID_FK fields.
    No code required!!


    I did add buttons to navigate record, so each button has 1 or 2 lines of code - not required to scroll through the student names, but nice to have.
    Click image for larger version. 

Name:	form1.jpg 
Views:	9 
Size:	62.9 KB 
ID:	29213

    Using this form, you can select a student, then select the courses required.




    PS: I'm not really crazy about the multi-field PK fields. I would use an autonumber field and set a unique index on fields where I want to have unique records.

    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 08-06-2014, 09:47 AM
  2. Replies: 2
    Last Post: 07-21-2014, 08:47 AM
  3. Web Database - Cascading Combo boxes
    By mmandel1 in forum Access
    Replies: 8
    Last Post: 01-22-2014, 02:57 PM
  4. student account database
    By jlmyree24 in forum Access
    Replies: 1
    Last Post: 10-24-2013, 12:39 AM
  5. Student Database
    By jlc668 in forum Database Design
    Replies: 2
    Last Post: 10-09-2013, 03:26 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums