How to write VBA to filter query ?

cheer

Registered User.
Local time
Tomorrow, 04:52
Joined
Oct 30, 2009
Messages
222
How to resolve VBA filtering query issue ?

I have these pieces of codes inside my form (name: frmBOMComparisonQuantity)
If optStandardQty.Value Then
DoCmd.OpenQuery "Report_BOM_Comparison_StandardQty_WithoutUnitPrice", acViewNormal
ElseIf optBalanceQty.Value Then
DoCmd.OpenQuery "Report_BOM_Comparison_BalanceQty_WithoutUnitPrice", acViewNormal
End If

I have inserted below code into the QUERY : Report_BOM_Comparison_StandardQty_WithoutUnitPrice and Report_BOM_Comparison_BalanceQty_WithoutUnitPrice . Both queries are the pivot table format.

[Forms]![frmBOMComparisonQuantity]![txtOperator]
However, i obtain error message as attached during execution. Anyone has idea how to resolve the problem?
 

Attachments

  • Error.JPG
    Error.JPG
    60.9 KB · Views: 130
Last edited:
The information you have given suggests to me that there is no control on your form called txtOperator. Re-check the name of the control on your form that you are expecting the query to use.

Note that it is the name of the control that you are checking, not the name of the field that the control is bound to.

hth
Chris
 

Users who are viewing this thread

Back
Top Bottom