Re: Query criteria



Assuming your field ALWAYS has data you can use

LIKE IIf(Forms!Form1!Option=1,"Ohio","*")

Or if your field can contain nulls, you can force a value in it by appending
a zero length string and using the first option
Field: State: [TableName].[State] & ""
Criteria: LIKE IIf(Forms!Form1!Option=1,"Ohio","*")

If this is too slow, then there are other options available.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Jim Pockmire" <jpockmire@xxxxxxxxxxxxxx> wrote in message
news:45def746$0$28099$4c368faf@xxxxxxxxxxxxxxxxx
I would like set criteria based on a value from a form, such that if the
value from the form is "1" a specific recordset is returned and if the
value is not "1" all records are returned. Can this be accomplished in a
single criteria cell?

e.g. I tried the following without success

=IIf(Forms!Form1!Option=1,"Ohio", Like "*")



.



Relevant Pages

  • Re: Averages
    ... I need to track quantities for different sizes of each pipe ... >By recordset, I understand that you mean a table, judging ... or the result of a select query. ... >> recordset that would not allow zero values. ...
    (microsoft.public.access.forms)
  • Re: Database Structure Question ... Serious Help Only Pls
    ... Maybe simply appending with a query won't work... ... The only problem you might have is determining the primary key ... On your recordset object after you have updated the recordset issue a ... it, and append the parent table data, grab the PK as above and store it ...
    (comp.databases.ms-access)
  • Re: Averages
    ... recordset that would not allow zero values. ... on the record set appear as zero's as soon as any ... the value is zero [i ... In the query, I wrote in the criteria, but that ...
    (microsoft.public.access.forms)
  • RE: SQL Server Error Trapping in ASP/ASP.NET
    ... You should still encounter the ... > successfully returning a recordset. ... > Command.ExecuteNonQuery - will return an error (Divide By Zero) ...
    (microsoft.public.dotnet.framework.adonet)
  • SQL Server Error Trapping in ASP/ASP.NET
    ... successfully returning a recordset. ... Command.ExecuteNonQuery - will return an error (Divide By Zero) ... Raiserror to roll up to ASP and ASP.NET in all situations and not be ignored ...
    (microsoft.public.dotnet.framework.adonet)