![]() |
Convert SQL query Sub to Function
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. |
Convert SQL query Sub to Function
either of these espressions will give you the value
rst.getstring rst.fields(0).value "Steve" wrote: 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. |
Convert SQL query Sub to Function
Beautiful, it works. Thanks.
|
All times are GMT +1. The time now is 01:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com