Update dynamicly a query field formula

  • Thread starter Thread starter thread
  • Start date Start date
T

thread

Hi All,

Is it possible to update a query formula by vba code?
for now i found a solution by just building a dynamic query,but i
prefer to have an option to update just one field with new formula
from time to time,
is it posible?
 
The only way would be to reset the SQL property of the QueryDef object.
 
can you give me an example on how to do it?

Douglas J. Steele כתב:
 
Dim qdfCurr As DAO.QueryDef
Dim strSQL As String

strSQL = "SELECT Field1, Field2, Field1 + 2*Field2 AS Calculation " & _
"FROM MyTable ORDER BY Id"
Set qdfCurr = CurrentDb().QueryDefs("MyNamedQuery")
qdfCurr.SQL = strSQL

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


can you give me an example on how to do it?

Douglas J. Steele ???:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top