By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,666 Members | 1,603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,666 IT Pros & Developers. It's quick & easy.

How to prevent the overlapse range entry ?

chinfk
P: 15
Hi There,

I hav a entry said order serial no from 001 - 700, in the QA approval entry for this range no could be partial.

Less said 1st lot - (001 - 100), 2nd lot - (300 - 420) and so on.
How to prevent user to key in 050 - 070 or something are in within the previous entry ?

I had manage to limit the entry from 001 - 700, but in between that overlapse is had to control.

Any suggestion on control this? Thanks in Advance. =)
Oct 24 '07 #1
Share this Question
Share on Google+
7 Replies


FishVal
Expert 2.5K+
P: 2,653
Hi, there.

Take a look at Iif query thread.
The question there was just the same but with time intervals instead of your's numeric intervals.

Regards,
Fish
Oct 24 '07 #2

chinfk
P: 15
Hi Brother FishHal,

Thanks for your helps and i have modify to what my program needs, it works definitely.

Thanks and wish you have a nice day ya!
Oct 24 '07 #3

FishVal
Expert 2.5K+
P: 2,653
:)

Glad you've got it work.
Have a nice day too, and all subsequent days even more nice.

Best regards,
Fish
Oct 24 '07 #4

chinfk
P: 15
Hi Brother Fish,

There is the loop hole in my program which it can detect the overlapse range
But for the value that smaller or larger than the current range of data, it can't
allow that.

My code as below:

If DCount("[ID]", "Temp-QA2", "((str(SN) > " & .SN & " And str(SN) < "
& .EN & ")

OR (str(EN) > " & .SN & " And str(EN) < " & .EN & ")
OR (str(SN) <= " & .SN & " And str(EN) >= " & .EN & ")) <> 0 ") Then
Me.Undo
Me.SN.SetFocus
ValidateSerialNoSlot = False
ElseIf DCount("[ID]", "Temp-QA1", "((str(SN) < " & .SN & "
And str(SN) < " & .EN & ")
OR (str(EN) < " & .SN & " And str(EN) < " & .EN & ")) > 0 ") Then
ValidateSerialNoSlot = True
End If

Let said the order range is from 001 - 700.

1st line item - 005 - 100
2nd line item - 001 - 004 ( cannot key) or 101 - 300 ( cannot Key also)

But if 2nd line item - 006 - 099 ( it detect error = false)
- 004 - 099 ( it detect error = false)
- 003 - 099 ( it detect error = false)

Please help to look into my code why it cannot allow to key value that
smaller or larger than the current set of data,

Thanks very much in advance. =)
Oct 25 '07 #5

FishVal
Expert 2.5K+
P: 2,653
Hi, chinfk.

You don't need to convert table field numerical value to string in order to compare it with TextBox.Value. TextBox.Value property returns Variant type variable.
Moreover if you convert table field value from numerical type to string comparison rules change to those for strings (char by char comparison from left to right until operand1 char <> operand2 char).

Example:
123 > 98 = True
but
"123" > 98 = False
"123" < 98 = True
Oct 25 '07 #6

chinfk
P: 15
Hi Brother FIsh,

The order no range will consist of alphanumeric value, so i had to string it else will get data type mismatch error.
Oct 26 '07 #7

FishVal
Expert 2.5K+
P: 2,653
Hi Brother FIsh,

The order no range will consist of alphanumeric value, so i had to string it else will get data type mismatch error.
?

Plz, translate it to English. :)
Oct 26 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.