Using a form to amend the search criteria of a query and display results in the form?

imellor

Registered User.
Local time
Today, 19:22
Joined
Jul 9, 2009
Messages
17
Hi All

I'm an MS Access newbie and I was wondering you would be able to help me with a form and query?

I've done some googling of the problem and I have come up with the following:

I have a table of telephone extentions called "ACD-C"
I have a query "called qryRecordedBySite"
and I have a form "frmTotalRecorded"

The SQL in the query is:
SELECT Count([ACD-C].Ext) AS CountOfExt
FROM [ACD-C]
WHERE ((([ACD-C].Ext) Like [Forms]![frmTotalRecorded]![txtSiteCode]));

On the form I have the text box "txtSiteCode" which is where I will be entering the query (at the moment it is set as a default value, as I also can't get the submit button to work)

I have another text box with the following in:
"=DLookUp("[qryRecordedBySiteACDC]![CountOfExt]","[qryRecordedBySiteACDC]")"

When I run the form, I recieve a flashing error, which I believe naybe a symptom of my programming running in a loop?

Can anyone point me to a solution?

Also, I have a button with a onclick event of me.refresh to load the form again, but this results in an error :-)

Any help would very much br apprechaited.

Regards

Ian
 
Last edited:
The search tool described [Link removed] may be of interest to you.

Thank you, I've realised what I was doing wrong with my command button, I have added the =dlookup to the onlick event.

The only thin, I'm not sure about now, is if I should be pointing to a query at all, should I do the query in the onclick event as well?

Regards

Ian
 

Users who are viewing this thread

Back
Top Bottom