The poster would need to change his table if you are going to use BETWEEN.
For example 200 would match two rows in his table. Your code would work,
but it would return two rows in this case. Since the query has no order by
clause it is __possible__ that it could return different values on
subsequent runs. Not probable, but it is possible.
John,
What you say is true, however, the poster's code (as is) merely gets the
first row that matches the criteria, and as we know, the term "first" is
rather arbitrary. He could have used DLookup, to similar effect. At least
with a recordset, he has the opportunity to sort the result.
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
> The poster would need to change his table if you are going to use BETWEEN.
> For example 200 would match two rows in his table. Your code would work,
[quoted text clipped - 73 lines]
>>> plz give me some solution
>>> niyaz@flmetal.com.sg
John Spencer - 15 Dec 2005 13:33 GMT
Graham,
I hope I didn't sound critical. I just meant to alert the poster that
he/she might need to alter the code a bit or alter the table. In other
words, the poster needed to make a change and needed to decide which way to
eliminate the possibility of ambiguous results.
Perhaps I should have gone into further detail and offered a specific
solution.
Thanks for your understanding,
John Spencer
> John,
>
[quoted text clipped - 86 lines]
>>>> plz give me some solution
>>>> niyaz@flmetal.com.sg
Graham R Seach - 15 Dec 2005 22:07 GMT
<<I hope I didn't sound critical.>>
Not an issue. I should have explained that myself.
Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
> Graham,
> I hope I didn't sound critical. I just meant to alert the poster that
[quoted text clipped - 98 lines]
>>>>> plz give me some solution
>>>>> niyaz@flmetal.com.sg