Solved

Help with elements of a form and ADO

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

815 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

11 Experts available now in Live!

Get 1:1 Help Now