PDA

View Full Version : Solved: Enter Paramter Value



Imdabaum
01-10-2007, 03:22 PM
:help I read up in the MS site, but didn't find any help. Still working with real estate, but one of the representatives wanted me to add a feature where he can create a report based on certain properties that he marks.

I created a table to keep track of which properties were being tracked and by whom. Built a query to pull properties watched by specific agents. I combined the 2 queries into a new query and set that as the data source for the report. The query runs fine if I just run it from the design view or open it from the DB window.

When I open the report from the dialog box, however, it always prompts me to Enter a Parameter Value.


SELECT qryWorkOrders.ID, qryWorkOrders.OurClient, qryWorkOrders.PropertyTitle, qryWorkOrders.PropertyNumber,
qryWorkOrders.ProjectType, qryWorkOrders.Description, qryWorkOrders.WorkOrder, qryWorkOrders.RER,
qryWorkOrders.CurrentPhase, qryWorkOrders.PhaseName, qryWorkOrders.CompletionDate, qryWorkOrders.ContactDesc,
qryWorkOrders.ContactName, qryWorkOrders.RERName, qryWorkOrders.Active, qryWorkOrders.ReportType, qryWorkOrders.ProcessID, qryWorkOrders.Comments
FROM qryWorkOrders, qryGetWatchList
WHERE (((qryWorkOrders.ID)=[qryGetWatchList].[propertyid]))
WITH OWNERACCESS OPTION;



tblPropertyTracker
propertyid
RERP

qryGetWatchList
SELECT tblPropertyTracker.propertyid, tblPropertyTracker.RERP
FROM tblPropertyTracker
WHERE (((tblPropertyTracker.RERP)=[Forms]![DialogCustomReport]![criRER]));

Any ideas how to fix this? MS says that it is a problem with one of the fields not being recognized, but I don't see why my field wouldn't be recognized.
Any help fixing the parameter prompt is appreciated.:help

Imdabaum
01-10-2007, 03:53 PM
Just showing that even after a year of this, I'm still no expert. I set the criteria in the query for the RERP to =Form![DialogCustomReport]![criRER] then on the dialog box the OK button executes the following code.


Private Sub cmdOK_Click()
Dim sSQL As String
sSQL = "RERP = " & Me!criRER
DoCmd.OpenReport "rptCustomWorkOrder", acViewPreview, , sSQL
End Sub

I commented out the sSQl = "RERP = " & Me!criRER and it works fine now.

So now my question is, why can I not think of answers to problems when I spend hours looking at it, but once I make a post the answer comes to you? Is it psychological?(retorical) Thanks for letting me think out loud.

OBP
01-11-2007, 05:15 AM
I have been working with Access for over 10 years and still have that kind of problem (and answer). :dunno
Yours came very quickly once you had posted on here, less than 31 minutes, I usually have to sleep on it or have a bath or something.

So the moral is - don't waste time trying to find the answer, create a post and the answer will come to you. :rotlaugh:

Imdabaum
01-13-2007, 01:00 PM
I have been working with Access for over 10 years and still have that kind of problem (and answer). :dunno
Yours came very quickly once you had posted on here, less than 31 minutes, I usually have to sleep on it or have a bath or something.

So the moral is - don't waste time trying to find the answer, create a post and the answer will come to you. :rotlaugh:

:friends: Agreed.

I guess I should learn why that caused the problem in the first place instead of just not doing it... but that would be more weekend research.