Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Parmeter Query

Status
Not open for further replies.

bells

MIS
Oct 5, 2001
51
0
0
CA
Hello All
I am trying to use a customized Parameter query Dialog box In access query.
I created the dialog box [digBox] using a form

and I have the following in the criteria raw of my query

[FORMS]![digBox]![TEXT0]

but the problem is that instead of the custom dialog "digbox" form the default MS access parameter dialog box keeps coming showing forms!digBox!text0

Any Idea why this happening??
Thanks
 
The form must be open before launching the query.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

If you mean to run the "digBox" the customized form. Well I did run and when I run the query after that nothing comes and the query result comes with nothing. any reason why?
Thanks again
 
PH didn't mention "run" the form. He stated the form must be open when the query is run.

If that doesn't work, can you provide the SQL view of your query?

Duane
Hook'D on Access
MS Access MVP
 

Well Open the form it is the same the SQL is as follows


SELECT ServicesProvided.ServiceID, ServicesProvided.ServiceType, ServicesProvided.OVCId, ServicesProvided.CGId, ServicesProvided.DateProvided, ServicesProvided.ComponentId, ServicesProvided.Others
FROM ServicesProvided
WHERE (((ServicesProvided.OVCId)=[forms]![digBox]![text0]) AND ((ServicesProvided.DateProvided)=[forms]![digBox]![text2]));

Thanks again
 
bells,
I don't understand your answer. Just answer this question:
Is the dlgBox form open prior to and while opening the query?

In addition, have you attempted to either remove or type in values in the WHERE clause to replace the references to the controls on the dlgBox form?


Duane
Hook'D on Access
MS Access MVP
 

dhooKoom

My answer to both of Ur questions is Yes
I Open the form prior and while opening the query, and also I replaces the two references with values of "OVCId" and "DatesProvided" and in this case I receive the result. Not only that i can also use the default Access parameter entry dialog and with that it also gives me the result.The only problem is that when I want to use the customized dialog box ("digBox") it is not showing up at all. Hope I answered Ur question
Thanks again
 

There is no code that opens the form but the Query is a recordSource of a report which will be generated based on the criteria.
 
bells said:
The only problem is that when I want to use the customized dialog box ("digBox") it is not showing up at all.
What is not showing up at all? Are the records not displaying or is the form not displaying? If the records are not displaying is it only in the report or are you opening the query directly?

What happens if you change the SQL to
Code:
SELECT ServicesProvided.ServiceID, ServicesProvided.ServiceType, ServicesProvided.OVCId, ServicesProvided.CGId, ServicesProvided.DateProvided, ServicesProvided.ComponentId, ServicesProvided.Others
FROM ServicesProvided
WHERE OVCId=[forms]![digBox]![text0];



Duane
Hook'D on Access
MS Access MVP
 

1st I open the form, then when I go to the query the form stays behind
Now using my own SQL or the SQL statement you provided above I press the exclamation mark to run the query.
At this point the "digBox" does not come at all. It Just show me the result in dataSheet view (which is empty).
Actually it should give same records.
I hope I am making sense

Thanks again
 
If you don't see any records then the value in the controls in your form do not match the values stored in your table.

Do you use lookup fields in your table(s)?

Duane
Hook'D on Access
MS Access MVP
 
OK, I rephrase my reply:
The form must be open AND POPULATED before launching the query

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You can trouble shoot by opening the debug window (press Ctrl+G) and enter:
Code:
? [forms]![digBox]![text0]
What value does this return? Is is the same as the values stored in the field?
Then try:
Code:
?[forms]![digBox]![text2]
Again do you see the value you expected?


Duane
Hook'D on Access
MS Access MVP
 

Thank u for Ur time dhookon

? [forms]![digBox]![text0] Gave me the value I expected

but

? [forms]![digBox]![text2] return Null in debug window

text 2 was supposed to pass a date value(Medium Date). I pick the date from date picker.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top