Hi.
I am trying to pass the openargs to a report On Open (or on load event, I don't know which would be preferred). I have the code figured out (with prior help of Access World Forums) for the on click event of the form for openargs. Now, I've been trying to figure out the On Open/On Load code for the report so it opens to the openargs value (fk). I'm stuck.
The form is named Menu. The field on the form containing the report name is Test. The report is named r_Person. The field on the report that the openargs is to be passed to is fKPerson.
My code from On Click event from the Main form is:
If [fkFormReport] = 2 Then
DoCmd.OpenReport Me.Test, acViewReport, WhereCondition:="[fkPerson]=" & Me![fkPerson], OpenArgs:=Me.fkPerson
End If
Any help is appreciated.
I am trying to pass the openargs to a report On Open (or on load event, I don't know which would be preferred). I have the code figured out (with prior help of Access World Forums) for the on click event of the form for openargs. Now, I've been trying to figure out the On Open/On Load code for the report so it opens to the openargs value (fk). I'm stuck.
The form is named Menu. The field on the form containing the report name is Test. The report is named r_Person. The field on the report that the openargs is to be passed to is fKPerson.
My code from On Click event from the Main form is:
If [fkFormReport] = 2 Then
DoCmd.OpenReport Me.Test, acViewReport, WhereCondition:="[fkPerson]=" & Me![fkPerson], OpenArgs:=Me.fkPerson
End If
Any help is appreciated.