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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I set up an Input Box Loop

Status
Not open for further replies.

Jekyll

Technical User
Jun 30, 2000
5
IE
I need to query a column for a variety of numbers, and the way I am hoping to do it is to setup an Access Macro and a loop asking for numbers (through an Input Box).<br><br>I then want the Macro to stop asking for numbers when I key in a Zero (for example).<br><br>So I need to setup a VB loop which will run until input value is not greater than zero.<br><br>I have been trying this using the help examples - So any guide on where to start what to do would be great.<br><br>Cheers.<br><br>
 
Just in addition,<br><br>I'm guessing (literally) that I'll be using something like<br><br>While val &gt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(instead of counter)<br><br>and <br><br>Wend ' End While loop when Val = 0<br><br>----------------------------<br><br>But I'm just not sure of the layout or how to set it all up.<br>
 
DO WHILE val &lt;&gt;0<br><br>. . .{enter loop code here}<br><br>LOOP
 
Thanks. That'll sort out the stop condition. Just a couple of related questions though.<br><br>Is the SQl just entered direct into the Query SQL view?<br>If the loop is coded into the query, then is there a need for a macro to run it? <br><br>Is the loop code more than just the code used to do a single query using the input box?<br><br>e.g.<br>SELECT *<br>FROM SomeColumn<br>WHERE Number IN <br>( definedmodulefunction() );<br><br>Sorry for all the questions, but it's all still quite new to me and neither Access help nor trial and error has yet turned up much success.<br><br>Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top