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

VBA Code to set a filter

Status
Not open for further replies.

3535

Programmer
Dec 19, 1999
18
US
Can anyone tell me what is wrong with this line of code, I get error &quot;2448&quot;<br>
Me.Filter = &quot;Territory = &quot; '& InputBox(&quot;Get Territory:&quot;,&quot;Get Territory&quot;)&&quot;&quot; '<br>
<br>
<br>

 
It should be:<br>
<br>
Me.Filter = &quot;Territory = &quot;&quot;&quot; & InputBox(&quot;Get Territory:&quot;,&quot;Get Territory&quot;) & &quot;&quot;&quot;&quot;<br>

 
Thanks Rochelle, will try it again. Ray<br>

 
Works fine now on Text field, one more question, how do I get this code to filter to Number field ?<br>
<br>
<br>

 
Try this<br>
<br>
Me.Filter = &quot;NumericFieldName = &quot; & InputBox(&quot;Get Numeric Field:&quot;,&quot;Get Numeric&quot;)<br>
<br>
<br>
<br>

 
Thanks Rochelle, once again your advise works great. Ray<br>
<br>
<br>
<br>
<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top