Help with controbox code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I'm trying to create a textbox that will count the name of the most used
proctor in the last 7 days, but instead of giving a number total, it displays
the name of the most used proctor.

I created this in the control box:
=DMax("[Proctor]","L7DProctor"," [DateIn] = Date() -7")

Instead of getting the most used proctor, it displays another proctor's name
with a lesser total.

For example,
If Gail’s name was used 70 times, Donna was used 83 times, barb was used 40
times, and Pauline was use 52 times the text box displays Donna instead of
Gail.

I also tried Dmin and it gave the wrong name also.

Any help would be great

Thank you
Dave.
 
David said:
Hello,

I'm trying to create a textbox that will count the name of the most used
proctor in the last 7 days, but instead of giving a number total, it
displays
the name of the most used proctor.

I created this in the control box:
=DMax("[Proctor]","L7DProctor"," [DateIn] = Date() -7")

Instead of getting the most used proctor, it displays another proctor's
name
with a lesser total.

For example,
If Gail's name was used 70 times, Donna was used 83 times, barb was used
40
times, and Pauline was use 52 times the text box displays Donna instead of
Gail.

I'd expect that 83 would appear to your database to be more than 70. But
I'd also expect you'd need DMax of the Count of the times the proctor was
used. So unless you're querying against another query that's counting the
times used, that's probably your problem.

HTH;

Amy
 
I messed up in my example. I meant to write "the text box displays Gails(70)
name instead of Donna(83).

The L7dProctor is a query based of a table.

I have tried several things
Query by date and not in the expression
Grouping in the query

Nothing seems to work.

"I'd also expect you'd need DMax of the Count of the times the proctor was
used."

How would I Dmax the count in the expression?
Not sure what you mean here can you give me an example.

Thank you
David

Amy Blankenship said:
David said:
Hello,

I'm trying to create a textbox that will count the name of the most used
proctor in the last 7 days, but instead of giving a number total, it
displays
the name of the most used proctor.

I created this in the control box:
=DMax("[Proctor]","L7DProctor"," [DateIn] = Date() -7")

Instead of getting the most used proctor, it displays another proctor's
name
with a lesser total.

For example,
If Gail's name was used 70 times, Donna was used 83 times, barb was used
40
times, and Pauline was use 52 times the text box displays Donna instead of
Gail.

I'd expect that 83 would appear to your database to be more than 70. But
I'd also expect you'd need DMax of the Count of the times the proctor was
used. So unless you're querying against another query that's counting the
times used, that's probably your problem.

HTH;

Amy
 
In your other query, you'd have a field that counted how many times the
proctor was used. In this query, you'd use DMax on that column.

I can't be more specific unless you are. Or I could, but I am not going to
make up a fake table/query structure simply because you haven't provided
your real one

HTH;

Amy

David said:
I messed up in my example. I meant to write "the text box displays
Gails(70)
name instead of Donna(83).

The L7dProctor is a query based of a table.

I have tried several things
Query by date and not in the expression
Grouping in the query

Nothing seems to work.

"I'd also expect you'd need DMax of the Count of the times the proctor was
used."

How would I Dmax the count in the expression?
Not sure what you mean here can you give me an example.

Thank you
David

Amy Blankenship said:
David said:
Hello,

I'm trying to create a textbox that will count the name of the most
used
proctor in the last 7 days, but instead of giving a number total, it
displays
the name of the most used proctor.

I created this in the control box:
=DMax("[Proctor]","L7DProctor"," [DateIn] = Date() -7")

Instead of getting the most used proctor, it displays another proctor's
name
with a lesser total.

For example,
If Gail's name was used 70 times, Donna was used 83 times, barb was
used
40
times, and Pauline was use 52 times the text box displays Donna instead
of
Gail.

I'd expect that 83 would appear to your database to be more than 70. But
I'd also expect you'd need DMax of the Count of the times the proctor was
used. So unless you're querying against another query that's counting
the
times used, that's probably your problem.

HTH;

Amy
 
Back
Top