LINKING FORM TO REPORT

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello again to all acces users.

Here is a question, I've been trying to solve for a long time.
I have this form presenting data of a training course.
And have a report presenting data of the students that attended the training.
The Report has the following structure.
Main report: data of company promoting the training course.
Subform: presenting data abaout one specific training course
Subform.subform: presenting data of the students.

Now, the linking data is a alfanumeric code located in the main subform that
identifies the training course. How can I have a button linking a form and
locates in the report the training course presented in the subform.

If this is not clear, please ask or present doubts.

Greatings from Portugal.
AlipioSequeira.
 
Hi

Create a new button "on the subform"


Private Sub ButtonName_Click()
DoCmd.OpenReport "ReportName", acViewNormal, , "FieldInTheReport = " &
Me.ControlOnTheSubForm
End Sub


Change these names
ButtonName
ReportName
FieldInTheReport
ControlOnTheSubForm

Note
ControlOnTheSubForm is the control on the subform showing details of the
course


Good luck
End Sub
 
Hello Wayne.

Thanks for your help.
Couldn't quite make it work.

Can we go to basics and script just for opening a report from a form linked
by a field named "Chave do curso".
Both fields are in the main form or report. so it shoul be fine for me to
understand the code.

Greatings from Portugal.
AlípioSequeira.
 
Back
Top