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
Solved

Help with elements of a form and ADO

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

856 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