VB Comparison Problem

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
 
L

Les

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]
 
P

Paul

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

.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top