R
Robin
Hello,
I'm trying to write the WHERE part of a multi-part SQL statement IN VBA and
the quotes within the DMin function are driving me mad! I have spent hours
to no avail!
I have searched this discussion group and cannot find a single example of a
Domain Aggregate function within a VBA string SQL statement.
The following is from the Query design SQL view which is what I want, but
formatted as a string variable in VBA. (I added the stSQLw1= and
opening/closing quotes.)
stSQLw1 =
"WHERE
(((ClientAssignment.CASequence)=DMin("[CASequence]","ClientAssignment","CAComplete = False AND "& _
"[ClientAssignment]![ClientID] = """ & [ClientEngagement]![ClientID] & """
AND "&_
"[ClientAssignment]![EngagementID] = """ & [ClientEngagement]![EngagementID]
& """ AND " & _
"[ClientAssignment]![EngagementYr] = """ & [ClientEngagement]![EngagementYr]
& """"))) "
Any help would be appreciated.
Thank you,
Robin
I'm trying to write the WHERE part of a multi-part SQL statement IN VBA and
the quotes within the DMin function are driving me mad! I have spent hours
to no avail!
I have searched this discussion group and cannot find a single example of a
Domain Aggregate function within a VBA string SQL statement.
The following is from the Query design SQL view which is what I want, but
formatted as a string variable in VBA. (I added the stSQLw1= and
opening/closing quotes.)
stSQLw1 =
"WHERE
(((ClientAssignment.CASequence)=DMin("[CASequence]","ClientAssignment","CAComplete = False AND "& _
"[ClientAssignment]![ClientID] = """ & [ClientEngagement]![ClientID] & """
AND "&_
"[ClientAssignment]![EngagementID] = """ & [ClientEngagement]![EngagementID]
& """ AND " & _
"[ClientAssignment]![EngagementYr] = """ & [ClientEngagement]![EngagementYr]
& """"))) "
Any help would be appreciated.
Thank you,
Robin