Hi,
I have the following problem. I want to use the DMin-function and I want to fill the domain- and criteria-section with a variable which is declared in the module.
So, I want to do something like this:
I have three queries qryProductFood, qryProductTools, qryProductElectronics. All queries hold a column 'RecordDate' and a colum 'ProductID' (and some other data). I want to find the oldest date from a certain product in the query with the function DMin.
(...)
Dim intProduct As Integer
Dim strType As String
Dim dtMin as Date
intProduct = Form_MAIN.ProductNumber.Value
strType = Form_MAIN.ProductType.Value
dtMin = DMin("RecordDate", "qryProduct & strType", "[ProductID]=intProduct")
Is this possible? I cannot get it to work, I cannot find code-snippets on internet which uses something like I want to do...
I have the following problem. I want to use the DMin-function and I want to fill the domain- and criteria-section with a variable which is declared in the module.
So, I want to do something like this:
I have three queries qryProductFood, qryProductTools, qryProductElectronics. All queries hold a column 'RecordDate' and a colum 'ProductID' (and some other data). I want to find the oldest date from a certain product in the query with the function DMin.
(...)
Dim intProduct As Integer
Dim strType As String
Dim dtMin as Date
intProduct = Form_MAIN.ProductNumber.Value
strType = Form_MAIN.ProductType.Value
dtMin = DMin("RecordDate", "qryProduct & strType", "[ProductID]=intProduct")
Is this possible? I cannot get it to work, I cannot find code-snippets on internet which uses something like I want to do...
Last edited: