Dar team
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.
When in debug mode I can see teh in immediate window teh query and when i put this query in query window in access it is returning the
data also which is very good
but in Actual from where I am using a function
The function is as follows
after completion of this fun.. I agin come in my main form where this fn has een written
after htis line rs.recordcount showing me as zero ??? so that is te reason run time error 3021 is coming..
Funny thing is if I remove liek operator it is wrking finme.
Request u r help
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.
Code:
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
Code:
set rs = getlastname(LastName)--(Last name is the Paramet er in above query)
Code:
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
Code:
set rs = getlastname(LastName)-
Funny thing is if I remove liek operator it is wrking finme.
Request u r help
Comment