Filter property

ponneri

Registered User.
Local time
Today, 18:20
Joined
Jul 8, 2008
Messages
102
Hi.

I have a table with a long data type field called slno (serial number). Examples : 3345, 912768, 523409 etc.

I have a form on which the user enters a serial no into a text box and clicks on a button to search. The form then shows only that record below.

I want to use the filter property but i don't know how to search a long data type.

dim x as long
x = val(text1.text)
me.filter = "slno = &x"
me.filteron = true

Is this correct ?
 
Last edited:
You need to concatenate the string correctly;

Code:
dim x as long

x = val(text1.text)
Debug.Print x
me.filter = "slno = " & x
me.filteron = true
 
Thanks Minty. It worked !

Had to use text1.value instead of text1.text due to control ref. issue.
 
If you use Me.Text1 then the value is the default property
Me. refers to the current form object and will allow intellisense to give you the available control names, which can save on typing errors.
 

Users who are viewing this thread

Back
Top Bottom