benkingery
Registered User.
- Local time
- Today, 15:22
- Joined
- Jul 15, 2008
- Messages
- 153
I posted on Friday a very similar issue with a recordset. I've used most of the recordset portion of that sample code, so I don't think there's a problem with that. I think there is some problem with how the SQL statement interacts with the recordset, but I don't know recordsets well enough to know what is going on.
Does anyone have anything they can see here?
I ran the SQL statement within a query builder and it definitely gives me the desired results....
Does anyone have anything they can see here?
Code:
Private Sub AZBuildTitle_Click()
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
strSQL = "SELECT [LiquidationTies].[Brand] + ' Mens' + IIf([AttributeData_Ties].[AZ_pattern_Style] Is Null,'',' ' + [AttributeData_Ties].[AZ_Pattern_Style]) + IIf([AttributeData_Ties].[AZ_theme] Is Null,'',' ' + [AttributeData_Ties].[AZ_theme]) + IIf([AttributeData_Ties].[EBOS_Material] Is Null,'',' ' + [AttributeData_Ties].[EBOS_Material]) + IIf([AttributeData_Ties].[EB_Style] Is Null,'',' ' + [AttributeData_Ties].[EB_Style]) AS AZ_TitleSQL, LiquidationTies.Parent_SKU FROM AttributeData_Ties INNER JOIN LiquidationTies ON AttributeData_Ties.Parent_SKU = LiquidationTies.Parent_SKU WHERE (((LiquidationTies.Parent_SKU)=[Forms]![Liquidation_Tie_DataCollection]![Parent_SKU]));"
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
Me.AZ_Title = rs!AZ_TitleSQL
Set Rs1 = Nothing
Set Db1 = Nothing
End Sub
I ran the SQL statement within a query builder and it definitely gives me the desired results....