KRoth472
Apr 22 2011, 06:19 PM
Hello UA,
I wish to filter a sub-form column to only show purchase orders that are open or all purchase orders (open or closed) by selecting a checkbox on the main form. I see from the database examples that are out there at MSDN how to do this with a macro expression but I would like to do this with VBA since I am not to confident with my macro expression design yet.
Any links or ideas would be great. I have done some extensive searching and have not found the coding structure required to do this yet. Thanks
KR
theDBguy
Apr 22 2011, 06:41 PM
Hi KR,
Check out the Filter property. You might end up with something like:
If Me.Checkbox = True Then
Me.Filter = "FieldName='open'"
Else
Me.Filter = "FieldName='closed'"
End If
Me.FilterOn = True
Hope that helps...
danishani
Apr 22 2011, 07:00 PM
You can try this, by using the Filter() option of the Subform;
In the OnClick Event of the Checkbox;
Dim chkPurchased As String
If Me.Check1.Value = True Then
chkPurchased = "[Purchased]='Open'"
[Form_YourSubFormName].Filter = chkPurchased
[Form_YourSubFormName].FilterOn = True
Else
[Form_YourSubFormName].FilterOn = False
End If
HTH,
Daniel
KRoth472
Apr 24 2011, 03:36 AM
Guys thanks for the info. That was exactly what I was looking for!
~KR
danishani
Apr 24 2011, 10:44 AM
Glad to help!

Cheers,
Daniel
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.