Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use Number Ranges using Text Boxes in a Form 1

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
GB
Hi,

I have a query that searches on co-ordinates entered into the Forms text boxes...
The Form is: SrchAdd
The Query is: NorthEast
The Fields within the Query are: MAPEAST and MAPNORTH
The Criteria for MAPEAST is the following:
Code:
Between ([forms]![SrchAdd].[text0]) And (([forms]![SrchAdd].[text0])+([forms]![SrchAdd].[text6]))
The Criteria for MAPNORTH is the following:
Code:
Between ([forms]![SrchAdd].[text10]) And (([forms]![SrchAdd].[text10])+([forms]![SrchAdd].[text12]))

The problem I am having is that if I enter the co-ordinates and enter the Additional Search Range.
The Query only outputs the co-ordinates.
The Query seems to ignore the Range Number Entered.

I have used normal numbers and that seems to have worked. But if I use the Text Boxes the Query ignores Text Boxes...


So if I enter 504893 it starts with that number and goes through the range of that number i.e. 504893 + (Text Box)
so, 504893 then 504894 then 504895 etc.

Please help.[smile]

Any help would be very much appreciated [smile]

Thank you for a great forum, and thank you all for the help already given [2thumbsup]
Kind regards
Triacona


 



Hi,

Can't do arithmetic on TEXT...
Code:
Between CLng([forms]![SrchAdd].[text10]) And CLng([forms]![SrchAdd].[text10])+CLng([forms]![SrchAdd].[text12])
assuming that this is integer arithmetic.


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip,


Thank you so very much [smile] it works!![bigsmile][2thumbsup]
Quick question...
Would 504893 as a number qualify as an integer?
(As it is above the below specified number range)
As per the definition below given by Microsoft?:

Integer Data Type:

Integer variables are stored as 16-bit (2-byte) numbers ranging in value from -32,768 to 32,767. The type-declaration character for Integer is the percent sign (%).

You can also use Integer variables to represent enumerated values. An enumerated value can contain a finite set of unique whole numbers, each of which has special meaning in the context in which it is used. Enumerated values provide a convenient way to select among a known number of choices, for example, black = 0, white = 1, and so on. It is good programming practice to define constants using the Const statement for each enumerated value.

Any help would be greatly appreciated [smile]
Kind regards
Triacona
 



There are "integer" data types which max at 32,768.

But integer numbers are an infinitely larger set than integer data types.

But I actually had you convert to the LONG data type CLng() rather than the integer data type, assuming that you were doing arithmetic with integers.



Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks!
That is great![bigsmile]
Thanks for all your help![cheers]
kind regards
Triacona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top