Hi All,
I am doing a search function on a form and would like to just use one text box for that search. I would like to use the after update event to check whether the input is a number (could be regular integer or LONG) or text. Then use that to search on different fields to filter the form. How do I check the input to see whether it is a number or text?
Thanks,
Mark
Check if entry is number or text
-
- 3StarLounger
- Posts: 253
- Joined: 19 Apr 2010, 09:01
- Location: Indiana, USA
Check if entry is number or text
Thanks,
Mark
Mark
-
- Administrator
- Posts: 78654
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Check if entry is number or text
You can use code like this:
where txtSearch is the text box.
Code: Select all
If IsNumeric(Me.txtSearch) Then
' code for numeric values goes here
...
Else
' code for text values goes here
...
End If
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 253
- Joined: 19 Apr 2010, 09:01
- Location: Indiana, USA