Convert SQL query Sub to Function

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I have a macro that queries an access database, and would like to turn
it into a user-defined function. The recordset that is returned should
always be one value only. I am stuck at this place in my code:

rst.Open SQLstr, conn
Range("C1").CopyFromRecordset rst

It works now, returning the value to Range("C1") on the worksheet. How
do I assign the query result to a function value? Thanks.
 
Back
Top