How to Populate 'Filter' Property in Subform

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

In Access 2000, in a parent form, I am trying to set a filter on the
recordset in a subform as follows. The name of the subform control is
SubOrderScreen. The name of the form which is the source for the subform
control is SubOrderLine.

Me.SubOrderScreen.Form.RecordSource = "IDKey = " & 14

The line above generates the error:

"You entered an expression that has an invalid reference to the proprerty
Form/Report"

I've tried most combinations of periods and names, but to no avail.

What is the correct syntax to set a filter in a subform's recordset?

Many thanks,
Mike Thomas
 
I am not sure why your statement refers to RecordSource while it should be
Filter from your description???

Have you checked wether LinkMasterFields / LinkChildFields can be used?
 
I don't know if Me.SubOrderScreen.Form.RecordSource is a
typo in your message but try
Me.SubOrderScreen.Form.Filter = "IDKey = " & 14
Me.SubOrderScreen.Form.FilterOn = True

Hope This Helps
Gerald Stanley MCSD
 
Back
Top