open form, link criteria in subform

Jon.N

Registered User.
Local time
Today, 12:44
Joined
Nov 24, 2000
Messages
43
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.
 
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.
 

Users who are viewing this thread

Back
Top Bottom