Hello everyone
I was hoping someone could assist me with displaying a query result within a text field on a form. I created a query called qrychannelcount. I have two columns in it. It counts the different channels in the channel column based by vendor. Below is the sql from the query:
<code>
SELECT settlement.channel, Count(settlement.vendor) AS CountOfvendor
FROM settlement
GROUP BY settlement.channel
HAVING (((settlement.channel)="DOCA"));
</code>
I thought I could write a function and in the default value of the text field to call the function. Below is the function:
<code>
Public Function docacount()
docacount = CurrentDb.OpenRecordset("qrychannelcount").Fields(0)
End Function
</code>
Any suggestions on how I can get this to work or displayed in a text field? Thanks
I was hoping someone could assist me with displaying a query result within a text field on a form. I created a query called qrychannelcount. I have two columns in it. It counts the different channels in the channel column based by vendor. Below is the sql from the query:
<code>
SELECT settlement.channel, Count(settlement.vendor) AS CountOfvendor
FROM settlement
GROUP BY settlement.channel
HAVING (((settlement.channel)="DOCA"));
</code>
I thought I could write a function and in the default value of the text field to call the function. Below is the function:
<code>
Public Function docacount()
docacount = CurrentDb.OpenRecordset("qrychannelcount").Fields(0)
End Function
</code>
Any suggestions on how I can get this to work or displayed in a text field? Thanks