I have a function in my mysql database. I am trying to call the mysql function in my VBA inside a VBA funtion to get the result by passing parameter from the form. I cannot quite figure out how to do it. This is what I have so far
function getval(Id As Long) As String
Dim strSQL As String
Dim rsTch As DAO.Recordset
strSQL = "SELECT getname(" & Id & ")"
Set rsTch = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
End Function
But I am getting this error
Undefined function getname()
getname()
is my mysql function. I am getting result when i run the query in mysql workbench though.
getval()
is my VBA function from which I execute the query
id
is the parameter for the mysql function
please help me out