Solved

Help with elements of a form and ADO

Posted on 2004-09-20
5
136 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
  • 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now