georgesOne
Technical User
Hi,
after more than six hours I see no tree because of too much forest...
I have this query
SELECT DISTINCT DLookUp("ProductLine","htbl_ProductLine","ProductLineID = " & tbl_Formulation.ProductLine) AS ProductLine
FROM tbl_Formulation
WHERE NOT ISNULL(tbl_Formulation.ProductLine);
which works well and need now to make a more general expression as below:
strSQL = "SELECT DISTINCT DLookUp(""" & sField & """,""" & sTable & """,""" & sID & """ & tbl_Formulation.ProductLine) AS " & sField FROM " & cboTable & " WHERE NOT ISNULL(" & cboTable & "." & sField & ")"
where
sField = Controls("cboFieldName" & i)
sTable = "htbl_" & Controls("cboFieldName" & i)
sID = Controls("cboFieldName" & i) & "ID = "
values from combo controls are. This is for a generic search form.
This works also well, but I need to replace the specific term 'tbl_Formulation.ProductLine' in the LookUp function with the general terms 'cboTable' and 'sField'.
Nothing was successful. Any idea?
Thanks for any help & good night, georges.
after more than six hours I see no tree because of too much forest...
I have this query
SELECT DISTINCT DLookUp("ProductLine","htbl_ProductLine","ProductLineID = " & tbl_Formulation.ProductLine) AS ProductLine
FROM tbl_Formulation
WHERE NOT ISNULL(tbl_Formulation.ProductLine);
which works well and need now to make a more general expression as below:
strSQL = "SELECT DISTINCT DLookUp(""" & sField & """,""" & sTable & """,""" & sID & """ & tbl_Formulation.ProductLine) AS " & sField FROM " & cboTable & " WHERE NOT ISNULL(" & cboTable & "." & sField & ")"
where
sField = Controls("cboFieldName" & i)
sTable = "htbl_" & Controls("cboFieldName" & i)
sID = Controls("cboFieldName" & i) & "ID = "
values from combo controls are. This is for a generic search form.
This works also well, but I need to replace the specific term 'tbl_Formulation.ProductLine' in the LookUp function with the general terms 'cboTable' and 'sField'.
Nothing was successful. Any idea?
Thanks for any help & good night, georges.