filter format ?

adbftrainer

Member
Licensed User
hi

this code works, i do not understand the format of filters
how to use "" ' &

sname=txtdgname.text
sbreed=txtbreed.text
tbdog.filter("breed=" '& sbreed" ' ")

i want to add "OR sname" to the filter

thank you
sue
 

derez

Expert
Licensed User
Longtime User
you have to build the filter string using the rules of strings, and this string has to follow the filter rules.
sbreed is a string variable so you add it with & :

tbdog.filter("breed= " & sbreed )

The use of ' is in the case you put the string itself (not as a variable) in the filter, like
tbdog.filter("breed= 'Chiwawa' " )

to add an OR do this :

tbdog.filter("breed=" & sbreed & " OR name=" & sname)
Assuming breed and name are coulumn names, I don't know if this filter makes sense but the format should work.
 
Last edited:
Top