Sub-report query expression cannot refer to parent report field (1 Viewer)

Bonebaker

New member
Local time
Today, 06:19
Joined
Oct 27, 2017
Messages
4
Hi. I was having trouble with a sub-report.

I couldn't seem to refer to a field value in parent report within an expression in the sub report query.

Parent report and sub-report were master/child linked. I was trying to use a select query in the sub-report that needed to access a parent report field and use it in a criteria expression.

I had tried lots of different ways to refer to the parent field which contains the required value, such as:

  • Me.parent.ControlName
  • Me.parent.ControlName.value
  • Me.parent.fieldname
  • Forms!.......parentformname.ControlName

The correct syntax turned out to be:
[forms]![parentFormName]![fieldName]

I need to learn the rules re when to use a period and an exclamation mark.

All forms of syntax of xxxx seemed to get interpreted as parameters in my sub-report with a prompt for input when running the query.

My pain will hopefully save someone some time.
 
Last edited:

Bonebaker

New member
Local time
Today, 06:19
Joined
Oct 27, 2017
Messages
4
A solution was:
[forms]![parentFormName]![fieldName]

I need to learn the rules re when to use a period and an exclamation mark.
 

Users who are viewing this thread

Top Bottom