Hi,
I am trying to make a distinct count of records from a dataset that is generated by the following code:
I would like to put the result in the textbox [Text12] on the form [Leverantie vs meetgegevens]. The dataset is shown in a listbox on the same form. The distinct count has to be performed on the variable [bmp_id].
Can anybody give me a suggestion how to do this? It would be nice to have something like:
(This code give the error: "Compile error. Argument not optional" on the DCount.)
Or is it possible to use the sSql (which contains the dataset) in a DCount?
Thanks,
Tep
I am trying to make a distinct count of records from a dataset that is generated by the following code:
Code:
sSql = "SELECT * FROM [Leverantie vs meetgegevens] WHERE [Leverantie vs meetgegevens].lev_id = " & CbLeverantie.Column(0) & " ORDER BY bmp_id, methode;"
[SF Leverantie overzicht].RowSource = sSql
[SF Leverantie overzicht].Requery
Can anybody give me a suggestion how to do this? It would be nice to have something like:
Code:
Me![Text12].Value = DCount("SELECT DISTINCT [bmp_id]FROM [Leverantie vs meetgegevens]WHERE [Leverantie vs meetgegevens].lev_id = " & CbLeverantie.Column(0) & "")
Or is it possible to use the sSql (which contains the dataset) in a DCount?
Thanks,
Tep