A select returns records, you have nowhere for it to put them.

You need to create a recordset and work with it.

dim DB as dao.database
dim RS as dao.recordset
set db = currentdatabase()
set rs = db.openrecordset (strsql)
do until rs.eof
   handle the records
   rs.movenext
loop
rs.close
set rs = nothing


--- In [email protected], Lyanne Rheeza Ong <[EMAIL PROTECTED]> wrote:
>
> Hello, 
>    
>   i get an error run time error 3065, cannot execute a select query.
please help.
> 
>    
>   Private Sub cmdCreateUserClasses_Click()
>     strSQL = "SELECT Variable.ApplicationUserClassName,
Variable.ParentApplicationUserClassName " _
>             & "FROM Variable WHERE Variable.ApplicationUserClassName
= '" & Me.cboApplicationName & "';"
>     
>     Debug.Print strSQL
>     CurrentDb.Execute strSQL, dbFailOnError
>      
> End Sub
>    
>   How will i confirm if this returns a correct value? Can i use a
messagebox?
>    
>   thanks,
>   lyanne
> 
> 
> 
> L y a n n e  R h e e z a  C.  O n g
> 
>  
> 
> 
> 
>        
> ---------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. 
Try it now.
> 
> [Non-text portions of this message have been removed]
>


Reply via email to