VB Comparison Problem

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hey, I came across a problem and I was wondering if you
could help me. I have a form with 8 competitors' names &
times after a swimming race. I want to compare each time
and display the quickest time.

So far I have got 8 fields of times all formatted in long-
time format. I have another field called overall best
time. I need to compare the times and display the
quickest in overall best time.

This is the code so far - but dont think I'm correct:

Me![OverallBest] = Me![Entrant1Time]
If Me![Entrant2Time] < Me![OverallBest] Then Me!
[OverallBest] = Me![Entrant1Time]

What this idea was meant to do, was to put the first time
in the overall best time, then compare it with the
second. If the second was smaller than the overall best,
then it would be replaced
YEH - I KNOW IVE MADE A MESS OF IT

Any help would be greatly appreciated.

If you need to see it, U can always reach me via MSN
messenger and Remote assistance.
MSN Address is (e-mail address removed)

Thankx Again!

Paul
 
Paul,
It looks like you had the last line wrong. I think you
wanted Entrant2Time set to OverallBest. See below.

Me![OverallBest] = Me![Entrant1Time]
If Me![Entrant2Time] < Me![OverallBest] Then Me!
[OverallBest] = Me![Entrant2Time]
 
Yeh You're right buddy lol. Thankx mate
-----Original Message-----
Paul,
It looks like you had the last line wrong. I think you
wanted Entrant2Time set to OverallBest. See below.

Me![OverallBest] = Me![Entrant1Time]
If Me![Entrant2Time] < Me![OverallBest] Then Me!
[OverallBest] = Me![Entrant2Time]
-----Original Message-----
Hey, I came across a problem and I was wondering if you
could help me. I have a form with 8 competitors' names &
times after a swimming race. I want to compare each time
and display the quickest time.

So far I have got 8 fields of times all formatted in long-
time format. I have another field called overall best
time. I need to compare the times and display the
quickest in overall best time.

This is the code so far - but dont think I'm correct:

Me![OverallBest] = Me![Entrant1Time]
If Me![Entrant2Time] < Me![OverallBest] Then Me!
[OverallBest] = Me![Entrant1Time]

What this idea was meant to do, was to put the first time
in the overall best time, then compare it with the
second. If the second was smaller than the overall best,
then it would be replaced
YEH - I KNOW IVE MADE A MESS OF IT

Any help would be greatly appreciated.

If you need to see it, U can always reach me via MSN
messenger and Remote assistance.
MSN Address is (e-mail address removed)

Thankx Again!

Paul

.
.
 
Back
Top