Bill Bisco
Active Member
- Joined
- Aug 8, 2007
- Messages
- 446
Alright, I want to use the QueryDefs property to change the SQL of one of my queries to a different SQL. For Example:
Here's the Problem: Within my code I have used " ". [Station Name] & " " & [Side] AS Station
As a result I can't get VBA to work cause VBA wants " " to mean a beginning or end to a String But SQL wants " " to mean an additional word that I'm adding.
Is there any way to get VBA to process this SQL code without overly changing my database?
Sincerely,
Bill
Code:
Dim dbsCurrent As Database
Dim qryName As QueryDef
Dim strSQL As String
Set dbsCurrent = CurrentDb
Set qryName = dbsCurrent.QueryDefs("qryProcessSelectLSSubform")
strSQL = "SELECT tblProcesses.[Process Name], tblProcesses.ProcessSEQ, tblProcesses.StationID, tblStations.[Station Name], tblStations.Side, tblStations.StationSEQ, tblZones.[Zone Name], tblZones.ZoneSEQ, tblProcesses.Time, tblProcesses.ProcessType, tblProcesses.ProcessSubType, tblZones.LineSpeed, tblStations.StationID, [Station Name] & " " & [Side] AS Station, Sum(tblElements.ElementTime) AS SumOfElementTime"
As a result I can't get VBA to work cause VBA wants " " to mean a beginning or end to a String But SQL wants " " to mean an additional word that I'm adding.
Is there any way to get VBA to process this SQL code without overly changing my database?
Sincerely,
Bill