.sql replace for more than one field

dj59

Registered User.
Local time
Today, 10:27
Joined
Jul 27, 2012
Messages
70
I'd like to use the follwong code to replace more than one field in the query. Can you tell me how that is done?

Code:
Dim qdf As DAO.QueryDef
Dim qdfOLD As String
Set qdf = CurrentDb.QueryDefs("qry_55")
With qdf
    qdfOLD = .SQL
 [B]   .SQL = Replace(.SQL, "c.cnty_cd = '01'", "c.cnty_cd='11'")[/B]
    ' Code to do stuff with SQL-string/query
    .SQL = qdfOLD ' Reset SQL to old setting
End With
Set qdf = Nothing
 
You can add another line with a second Replace() function.
 
Yes. that worked well. Thanks.
 

Users who are viewing this thread

Back
Top Bottom