View Full Version : Need help to add a "schoolName" in a form when a user clicks on a list of schoolnames


kets786
03-25-2008, 08:20 AM
Hello People,

Need some help, heres my explanation..

I have three tables with the following fields:

1. tblStudent (studentID (PK), studentName)
2. tblSchool (schoolID (PK), schoolName)
3. tblExam (fkstudentName, mathResult, sciResult, engResult and fkSchoolName)

I have a form called "frmExamDetails" that has the table "tblExam" as a source record and using the form I can select a student Name from a dropdown and enter in the marks of the student name selected. I also have a field that displays the schoolName which cannot be edited. Hence I have text box's locked property set to "Yes" so it only displays the schoolName and does not let the user to edit it.

Here is my Question, I need a button named "Assign School" and when pressed, it displays a list of all the school Names in another form and when
double click on one of the names in the list, it changes the School Name in the first form. Could someone plz advise me on how to do this? I have attached a sample database will all the table and forms to give you a clear picture.

Thanks,

(ps I cannot use a Dropdown for the school Name, I am required to only use the methoded mentioned above?)

namliam
03-25-2008, 09:07 AM
Seeing as this is most likely a school assignment... let me help you by pointing in the right direction

Using the events on the form/control you can find out if something has been double clicked. Then using the FORMS object you can rever to any open form in the database.

Good Luck

kets786
03-25-2008, 09:13 AM
Hi, thanks for your reply, lolz this is not a school assignment. I have actually built the application but my clients wants no one to edit the company name and have a button instead.

I gave this example and created a sample database to explain my problem. I just wanted to know how on double clicking from the list can update the change in my text box? Is using an sql update an effective way of doing this?

ajetrumpet
03-25-2008, 04:06 PM
try this Kets...