Query Results in a Text Box

  • Thread starter Thread starter shane
  • Start date Start date
S

shane

I'm having difficulities getting query results to show in a text box.

Explanation:

form "main" has the text boxes "sdate", "edate", and "total"

query "complainttotal" is a totals query where date is grouped by where, and
another column "date" is grouped by count. Criteria for date is between
"forms!main!sdate and forms!main!edate".

Running the query on its own returs the correct value.

The text box "total" has the "complainttotal" query has is record source.

The form is bound to query "complainttotal".

Opening the form the text box "total" displays 0. Again running the query
from the database window displays the correct value.

I suspect the dates on the form being part of the criteria may be a problem?
The dates are generated by a default value where "sdate" is
"=CVDate(Format(Date(),"m/yyyy"))" and "edate" is
"=CVDate(Format(Date(),"m/yyyy"))-1". Does the query try to run before the
date is loaded?
 
The query runs when the form is opened/loaded. Put me.requery in the after
update event of the sdate and edate boxes.
 
I wanted to add that the table I'm pulling from is named "complaints" and
contains also the field "dateopen", for this field the "between
forms!main...." criteria is set. Sorry for the additon, but wanted to make
sure I was giving enough information.
 
You do realize your dates are as shown below --
sdate edate
6/30/2009 7/1/2009

Did you want different dates?
 
Back
Top