View Single Post
  #1 (permalink)  
Old May 28th, 2005, 02:54 PM
eusebio eusebio is offline
Registered User
Join Date: May 2005
Location: , , Romania.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eusebio
Default pass the result of a query to a variable ...

I'm trying to pass the result of a query to a variable.
My code is something like that:

Public Function get_last_id(what) As Double
         Dim ds As Database
         Dim myX As Double
    Set ds = OpenDatabase("c:\itc\bd\gestiuneIOMC.mdb")
Select Case what
    Case Is = "ref"
    myX = ds.Execute("select max(nrreferat) from tabelreferate;")
    MsgBox myX
End Select
End Function

when I try to execute the function, I receive de message "Expected function or variable"
What should I do ?
Thanks in advance ...
Reply With Quote