I think what you need is pretty straightforward:
Dim sSQL As String
Dim dbs As Database
Dim qdf As QueryDef
sSQL = "SELECT * FROM table_2"
Set dbs = CurrentDb
Set qdf = dbs.QueryDefs("qryTable")
With qdf
.SQL = sSQL
.Close...
I only noticed that in your sql statement below:
strSQL = "DELETE tblChosenOnes.ChosenOnes* FROM tblChosenOnes WHERE (((tblChosenOnes.ChosenOnes)=(" & strCriteria & ")"
that you forgot the single quotes that have to go around strCriteria, as in:
=('" & strCriteria &...
I hope this is helpful:
Dim strSQL as String
Dim MyVar as String
MyVar = "Fred" 'or however else you set it
strSQL = "DELETE tblChosenOnes.ChosenOnes FROM tblChosenOnes WHERE (((tblChosenOnes.ChosenOnes)='" & MyVar & "'));"
I'm having trouble sending a set of query results to MS Word. I open Word and add a document, send text ok, now I want to send the results of a query and can't get that to work.
I tried and failed to get the syntax correct for the insertdatabase method. I've tried things like:
With wDoc...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.