View Full Version : open form, link criteria in subform


Jon.N
11-07-2001, 05:00 AM
I know the following would work if the 'End' field was in the form I am trying to open but its not. The 'End' field is in a subform of the form I am trying to open. The subform uses a different data source to the main form.

DoCmd.OpenForm "LinkFm", , , "[End]>= Forms![menu]![Text10]"

If anyone can come to my rescue and suggest something that will enable me to open a form based on a link criteria that is in a subform I will be forever grateful.

The_Doc_Man
11-07-2001, 05:31 AM
What I have done in the past is to find the sub-form's containing control (call it SubFrm) and update its "Filter" property, then set "FilterOn" to True. Then open the sub-form directly. If your criterion is a text field, try this.

SubFrm.Filter = "[End]>= """ & Me![Text10] & """"

(but if your criterion is a number and [End] is also a number,

SubFrm.Filter = "[End]>= " & CStr(Me![Text10])

SubFrm.FilterOn = True

SubFrm.Requery

or words to that effect.