Solved

Help with elements of a form and ADO

Posted on 2004-09-20
5
140 Views
Last Modified: 2010-05-02
Hello i have three tables (teachers, subjects, assignationofsubjects) and for each table i have create a form, i have already the form for teachers and subjects but i don't know how to do the third form for assignationofsubjects where the user select the teacher and the subject and do operations with like add, delete,....., and print all the assignation of subjects for a teacher.

Thanks for the help.
0
Comment
Question by:emont
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
UncleMidriff earned 70 total points
ID: 12104985
I am assuming that your Assignationofsubjects table has a field for a Teacher ID and a Subject ID.

I would do the following:

Have the user select a teacher from a combobox or listbox (you should populate the combobox or listbox with this info from the database) and then allow the use to select 1 of three options: Print Assignation* of Subjects, Add Assignation, and Delete Assignation.

If the user selects Print Assignation of Subjects, you need select all the records from the Assignationofsubjects table that have the selected teacher's Teacher ID in the Teacher ID field.  Once you have all those records in a recordset or dataset, you can do whatever you want to with them: display them onscreen, use them in a report, etc.

For Delete Assignation, just like before, use the selected teacher's Teacher ID to find all the corresponding records in the Assignationofsubjects table.  Display the results in a listbox and let the user select which one(s) to delete.  Delete them from the recordset or dataset and then update the database.

For Add Assignation, let the user select a subject from a combobox or listbox, and then use the Teacher ID of the selected teacher and the Subject ID of the selected subject to create a new row in the Assignationofsubjects table, placing the selected Subject ID in the Subject ID field and the selected Teacher ID in the Teacher ID field.  Update the database with this info and now that teacher will be linked to that subject.

I am assuming that you know how to use ADO to perform the various database operations mentioned above.  What I have given is just a basic plan of action for doing what (I think) you want to do.

Just let us know if you need anything else :) .



I would use the word "Assignment."
0
 
LVL 2

Expert Comment

by:UncleMidriff
ID: 12560028
I think the info I provided should be of some help to emont, but whatever you all decide is fine with me.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
passing parameter in sql procedure 9 68
SQL VB connection works in one PC and doesn't in another 15 74
Problem to With line 4 75
Assign a value in Excel V-Basic 3 29
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question