Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synching the same field

Status
Not open for further replies.

EastCoast

Instructor
Apr 13, 2006
31
US
I have a "Class" form with a field on it called "ClassID" and a cmdbutton on the same form named "Evaluations". When I click on the "Evaluations" button, I need it to take me to the "Evaluations" form (that part is working). I also have the "ClassID" field on the "Evaluations" form and I need that "ClassID" field to by synched up with the "ClassID" field from the "Classes" form.

Ex: If I'm looking at a value of 7 for my ClassID on my Classes form and I click on the Evaluations button, when I get to the Evaluations form, the ClassID field should also read "7".

So far I have tried putting
[ClassID] as the Control Source and
[ClassID] FROM Classes as the Row Source for the ClassID field in Evaluations, and it's not working.

Help
 
In the data source for the Evaluations form, build it on a query.

In the criteria for the the query, under Class id, enter forms!Class!ClassID


Should work automatically.

Notes: You will get an error if you open Evaluations form withpout the class form being open.

If you add a new record to evaluations, it will not automatically get the correct ClassID - that would require additional code.


There is anotehr way, where you could pass an argument in the form open as well. If this doenst work as you need, have a look at that.

 
One other thing to be aware of. My "Evaluations" form is a main form with a subform as well, so when I click to go to the "Evaluations" form, it will show me the Evaluation type and then in the subform show me everyone's eval scores so every eval in theory will be tied to that ClassID field. I won't be able to build this from a query because then I would not be able to see all records in the subform at once, unless you know of another way to do that.
How can I tie the fields together given that they are both based on tables?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top