Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Criteria to a report without a premade Query

Status
Not open for further replies.

Talonjpc

Programmer
Jul 29, 2002
21
0
0
US
Sorry if this question seems dumb to anyone but I need some help.
Can I open a form with certain criteria without creating a premade query, like putting a SQL WHERE statement in the OnOpen or OnActivate Events? The criteria would be based on a variable


Thanks in Advance,
Vinay
 
YES

In the DoCmd.OpenForm structure you have the option of opening it with a Filter name OR using a WHERE clause

DoCmd.OpenForm "FormName", "FormViewType", "FilterName", "WhereCondition", "DataMode", "WindowMode", "OpenArgs"


"WhereClause" is a string expression in the form of a Where clause without the word "WHERE"


QED.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top