helloworld
Registered User.
- Local time
- Today, 08:22
- Joined
- May 18, 2004
- Messages
- 62
How would you store the results of a qdf as a variable. I need it for a where condition when I am trying to open my report.
this is my code for the qdf (I am not sure what the item in quotations on the last line does)
and this is where I need to put in the results (the question marks)
Any help would be greatly appreciated!
this is my code for the qdf (I am not sure what the item in quotations on the last line does)
Code:
Dim dbs As Database, qdf As QueryDef, strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT [Data Element].[Standard_Data Element Name], Compound.[Standard_Cluster Compound Name] FROM [Data Element] INNER JOIN (Compound INNER JOIN Component ON Compound.[Standard_Cluster Compound Identifier] = Component.[Standard_Component Compound Identifier]) ON [Data Element].[Standard_Data Element Identifier] = Component.[Standard_Component Data Element Identifier] WHERE (((Compound.[Standard_Cluster Compound Name]) Like [Forms]![FullCompoundDataElementsReport]![Combo69]));"
Set qdf = dbs.CreateQueryDef("whyme", strSQL)
and this is where I need to put in the results (the question marks)
Code:
If (IsNull(Forms!FullCompoundDataElementsReport!Combo69) = False) And (IsNull(Forms!FullCompoundDataElementsReport!Combo71) = True) Then
If Forms!FullCompoundDataElementsReport![Check84] = True Then
stDocName = "Data Element"
data_criteria = "[Standard_Data Element Name] like '" & ???????? & "' and "
Else
data_criteria = "[Standard_Cluster Compound Name] like '" & Forms!FullCompoundDataElementsReport!Combo69 & "' and "
stDocName = "Compound Query"
End If
Else
data_criteria = "[Standard_Data Element Name] like '" & Forms!FullCompoundDataElementsReport!Combo71 & "' and "
stDocName = "Data Element"
End If
Any help would be greatly appreciated!