Linking from a subform

  • Thread starter Thread starter mzp
  • Start date Start date
M

mzp

Guest
Hope someone can help me with this:

1. I have a form called F_Progress.
2. I have a form called F_Property.
3. F_Property contains a subform called F_Job.
4. F_Property is linked to F_Job by the Job ID field. Its a one to many relationship.
5. F_Job is linked to F_Progress by the Job ID field as well. One job has many months progress.

What I want to achieve:

I want a button within the subform (F_Job) which when you click on opens the related record in F_Progress where the Job ID is the same as the one in the subform.

Any suggestions very much greatly appreciated.

MZP
 
Does the form F_Progress value depends on the value of the subform (Job ID) ?


In this case, I would declare a Global variable only to capture the Job ID in the subform. And then on the ON Open Event of the F_Progress, I write an SQL statement which will now the basis on the Record Source for the form:

i.e:

if isnull(JobID) then
mySQL = "Select......" --> without criteria
else
mysql = "Select.....Where..." ---> with Criteria pointing to JobID
endif
....
....
 

Users who are viewing this thread

Back
Top Bottom