moca said:
I doublechecked but there is no problem with the spelling. I still can't
find why it is asking a value for the drug name field.
I am going to explain to you how I did everything and maybe there's
something wrong with how I did some things.
I created a query on which I based my 2012 Sales report , so the only
parameter in that query was in the refilldate field to specify the period of
time (between 1/1/2012 and 31/12/2012). The fields in this Report and query
are Name, UPN (drug code), Amount (a calculated field) and Refill date
The second query is only based on the table drug, with the following field
Names: Name, UPN and Margin (calculated field). And then I created a report
based on this query called 2012 Margin
So my last step was to use the last report (2012 Margin ) as a subreport for
the 2012 Sales Report by linking them with the "Name" field.
I don't know why it isn't working, maybe should I include the "refilldate"
field in the qry 2012 Margin and put the a parameter too like what I did for
the 2012 Sales qry?
I can't see how adding a criteria would make a difference,
but you can try whatever you like. Sometimes we even learn
something from trying odd things ;-)
The popup prompt has the exact spelling the query/report
does not understand. Check it carefully, maybe you are not
looking in the right place (e,g, Sorting and Grouping) for
the offending name.
I'm getting a definite impression that you actually have a
field in a table that is named Name. Since that is probably
the name of the most common property in Access, I can
envision all kinds of things going wrong.
You really should not use built in names for your own
purposes (e,g, Name, Date, and many, many other common
wrods). You could try enclosing the field name in [ ] and
maybe(??) Access will realize its not one of its own items.
Best to change the name of the field to DrugName or
something similar.
Another thing you should try is opening the subreport
directly from the Database window (without using the main
report) to see if the main report's influence is part of the
issue.