need u r help
I am new to aceess . I am writign a query in access for finding the last name mathcing with criteria using Like operator.
Expand|Select|Wrap|Line Numbers
- selct a,b,c from Table1 where last name like '*"& Paramter value &"*'
data also which is very good
but in Actual from where I am using a function
Expand|Select|Wrap|Line Numbers
- set rs = getlastname(LastName)--(Last name is the Paramet er in above query)
Expand|Select|Wrap|Line Numbers
- Function getlastname(lastnamyName As String) As ADODB.Recordset
- Dim rs As ADODB.Recordset
- Dim strsql As String
- Dim da As New DABase
- strsql = "SELECT *"
- strsql = strsql & " FROM tables1 "
- strsql = strsql & " WHERE (((lastname) like ""*" & lastame & "*"")) ;"
- da.openConnection
- da.CommandText = strsql
- Set getlastname= da.openRecordset
- Set da = Nothing
- End Function
after completion of this fun.. I agin come in my main form where this fn has een written
Expand|Select|Wrap|Line Numbers
- set rs = getlastname(LastName)-
Funny thing is if I remove liek operator it is wrking finme.
Request u r help