BIRD_FAT
05-04-2009, 02:20 AM
I've been banging my head against the wall with this one for a day now, someone put me out of my misery, PLEASE!
I have a main form: FrmMacroCode, and a subform: SubProgram
on the main form the field MacroID is the primary key, it is linked in a One-to-One relationship to the MacroID field of the subform (also Primary Key). there is also another field on the subform: MacroProgram with the various office program names as a Value List: "Word";"Excel";"Access";"InfoPath";"Outlook";"PowerPoint";"Publisher";"OneNote";"General"
I have a command button on the main form: FilterWord through which I am trying to apply a filter, based on the subform, which would allow me to only see, on the main form, data related to the value "Word" on the subform.
Here is what I have:
Private Sub FilterWord_Click()
Me.FilterOn = False
Me.Filter = "Forms![FrmMacroCode]![SubProgram].Form.[MacroProgram]= '" & "Word" & "'"
Me.FilterOn = True
End Sub
I've tried all sorts of combinations of the Me.Filter =... line, but I'm obviously missing something!
Any ideas, Ladies and Gents?
I have a main form: FrmMacroCode, and a subform: SubProgram
on the main form the field MacroID is the primary key, it is linked in a One-to-One relationship to the MacroID field of the subform (also Primary Key). there is also another field on the subform: MacroProgram with the various office program names as a Value List: "Word";"Excel";"Access";"InfoPath";"Outlook";"PowerPoint";"Publisher";"OneNote";"General"
I have a command button on the main form: FilterWord through which I am trying to apply a filter, based on the subform, which would allow me to only see, on the main form, data related to the value "Word" on the subform.
Here is what I have:
Private Sub FilterWord_Click()
Me.FilterOn = False
Me.Filter = "Forms![FrmMacroCode]![SubProgram].Form.[MacroProgram]= '" & "Word" & "'"
Me.FilterOn = True
End Sub
I've tried all sorts of combinations of the Me.Filter =... line, but I'm obviously missing something!
Any ideas, Ladies and Gents?