<emily[...]@gmail.com> wrote in message
news:d0445ecd-fc14-4ee8-a920-dadc37e723a6@q14g2000vbn.googlegroups.com...
> Hurray!!! You are too cool... this fixed the problem with the error
> message. And.... it also lets me do a "Filter by Form" search!
Excellent!
> One more minor question: Do you know whether there is any way to
> specify this textbox as a number field though? When I try to filter
> recipes by those with less than 5 ingredients (ie., <5), it also
> returns anything more than 9 because it sorts the "1" in the numbers
> 10, 11, 12, etc. in front of 5. I looked on the "Data" tab of the
> textbook, but the only type field I saw was between plain text and
> rich text.
I'm guessing that's because the query engine doesn't know what type of value
will be returned by DCount(), so it uses the default type of Text. Let's
try forcing the value to a Long, and see if that helps:
SELECT
CLng(DCount("*","tblRecipeIngredients",
"fldRI_RecipeID=" & Nz(fldRecipeID,0)))
AS IngredientCount,
*
FROM tblRecipes;
> Just out of curiosity (to help me understand in the future)... which
> part of your query instructed to return ALL records of tblRecipes...
> the sole asterisk (*)???
No, the asterisk tells it to return all fields of each record. The
instruction to return all records is implied by the absence of a WHERE
clause, which would restrict the records returned. No WHERE clause = return
all records.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)