Connecting Tech Pros Worldwide Help | Site Map

Confused by parameter error dialog

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 24th, 2008, 12:15 PM
Member
 
Join Date: Oct 2006
Posts: 47
Default Confused by parameter error dialog

I am running a report in Access. When I click to run report, a dialog comes up for missing parameter, showing just the name of a table in the box.

Now if I just click ok without typing anything in, the report dispays perfectly.

But user wants it gone, and I am at a loss. Here is click Event code:
Expand|Select|Wrap|Line Numbers
  1.  Dim stDocName As String
  2.  
  3.     Dim strFilter As String
  4.  
  5.     stDocName = "rptPatientProfilebyInterviewID"
  6.  
  7.     DoCmd.OpenReport stDocName, acPreview
  8.  
and here is SQL generated by qry builder:

Expand|Select|Wrap|Line Numbers
  1. SELECT tblPatientProfile.*, tblInterviewRecord.*
  2. FROM tblPatientProfile INNER JOIN tblInterviewRecord ON tblPatientProfile.PatientProfileID = tblInterviewRecord.PatientProfileID
  3. WHERE (((tblInterviewRecord.InterviewID)=[Forms]![frmPatientProfile]![frmInterviewRecord subform]![InterviewID]));
  4.  
parameter dialog, comes up and shows tblPatientProfile

I can't figure out why this is popping up
Ken
Reply
  #2  
Old March 26th, 2008, 01:44 PM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

There's nothing in here I can see which would cause that Ken.

Can you copy the exact message from the error message box. If this can't throw any light we may have to look at using the Access Documentor function and searching through the results.
Reply
  #3  
Old March 26th, 2008, 03:34 PM
Member
 
Join Date: Oct 2006
Posts: 47
Default

The dialog, box, has nothing in it except the table name
'tblPatientProfile'
Reply
  #4  
Old March 26th, 2008, 04:08 PM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

So the title is Missing Parameter and the contents, pasted in exactly as requested, is 'tblPatientProfile' (including the quotes)?

This is leading to uncharted territory then, and we will need to use the Access Documenter feature to discover what is referring to this.
Reply
  #5  
Old March 26th, 2008, 06:31 PM
Member
 
Join Date: Oct 2006
Posts: 47
Default

Actually it is titled
Enter Parameter Value

Then above the input of dialog box it says tblPatientProfile
with no quotes

it has the normal ok button, and when I click it, without entering anything, the report prints or previews normally and correctly.

Thanks
Ken
Reply
  #6  
Old March 26th, 2008, 11:48 PM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

Ah. That's starting to make some sense.

Please try to run the SQL you posted, natively (as a query rather than as a data source for the report) and describe what you get.
Reply
  #7  
Old March 27th, 2008, 02:47 AM
Member
 
Join Date: Oct 2006
Posts: 47
Default

Ok I ran the query,
Expand|Select|Wrap|Line Numbers
  1. SELECT tblPatientProfile.*, tblInterviewRecord.*
  2. FROM tblPatientProfile INNER JOIN tblInterviewRecord ON tblPatientProfile.PatientProfileID = tblInterviewRecord.PatientProfileID
  3. WHERE (((tblInterviewRecord.InterviewID[b])=[Forms]![frmPatientProfile]![frmInterviewRecord subform]![InterviewID]));
Got dialog asking for the

[Forms]![frmPatientProfile]![frmInterviewRecord subform]![InterviewID]));

which I entered and got the correct reply.
A combination of fields from the two tables.

It normally gets that parameter from the form which originates the report request.
Reply
  #8  
Old March 27th, 2008, 12:13 PM
Member
 
Join Date: Oct 2006
Posts: 47
Default

Sorry had typo in the SQL in frame above

Expand|Select|Wrap|Line Numbers
  1. SELECT tblPatientProfile.*, tblInterviewRecord.*
  2. FROM tblPatientProfile INNER JOIN tblInterviewRecord ON tblPatientProfile.PatientProfileID = tblInterviewRecord.PatientProfileID
  3. WHERE (((tblInterviewRecord.InterviewID)=[Forms]![frmPatientProfile]![frmInterviewRecord subform]![InterviewID]));
  4.  
Reply
  #9  
Old March 27th, 2008, 01:26 PM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

Ken, that's clearly expressed and I now know that the problem is not in the SQL itself.

That makes life harder of course, so we now need to look at the Documenter facility. It's a neat trick anyway so may be of more general interest.

From your main database window select Tools / Analyse / Documenter.
Makes sure at this stage to include everything you can. Kitchen sink optional.

When you have created the document save it and then open it in Word (convert from RTF). Now search through the document for instances of the string (tblPatientProfile). This should find some less visible references which would take a deal of searching for (and digging around) in the main Access application.

You may find more items than you need and will need to ignore those elements which would not cause your problem.

Good luck, and let us know how you get on.
Reply
  #10  
Old March 27th, 2008, 03:31 PM
Member
 
Join Date: Oct 2006
Posts: 47
Default

NeoPa
I have looked over documenter, now should I be just checking the table, report and query I am worrying about or really check everything??

Ken
Reply
  #11  
Old March 28th, 2008, 10:02 AM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

For thoroughness, I would advise doing the whole lot. Also, it's hard to be more precise without the details in front of me.

Alternatively, you could try just the report itself and any related items (queries etc) first with a view to doing the whole lot later if nothing is uncovered. It's up to you.

When you have the (possibly enormous) document open in MS Word, simply do a search (Ctrl-F) for (tblPatientProfile) and examine all the occurrences found. You should find something that sets off alarm bells.

Let me know how you get on.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.