Parameter Issues - Phantom Parameters?

G

Guest

Hello All,

I am rewriting a database that has been used to keep track of projects at
the office, which was a mess before. One report in the old database is used
at a weekly meeting, and it is desired that the format, etc not change. I
therefore copied and pasted the report into the new database, and changed the
control sources to point to a new query. The report looks fine, and contains
all the correct data, but it prompts for a single parameter "approved".
Apparently, it has also been doing that in the old database for the past 2
years, as well. Leaving a null value and selecting OK brings up the report
properly, but it is a nusiance that I would rather not have in there, since
the database is going to finally be done correctly.

I at first assumed that the parameter was contained in one of the controls
on the report. I wrote the following routine to execute on the report's Open
event, to try and track it down:

Private Sub Report_Open(Cancel As Integer)
Dim ctl As Control
For Each ctl In Me.Controls
If (ctl.ControlType = acTextBox) Or (ctl.ControlType = acCheckBox)
Then
Debug.Print ctl.ControlName & " - " & ctl.ControlSource
ElseIf (ctl.ControlType = acLabel) Then
Debug.Print ctl.ControlName & " - " & ctl.Caption
Else
Debug.Print ctl.ControlName
End If
Next
End Sub

Unfortunately, the output does not reveal the offending control. If this
parameter is not due to the source query (which it is not, as the query is
new to this database), and not due to a control on the report, where else can
it be coming from? I would really like to get this cleared up. Thanks,

Matt
 
G

Guest

By the way, the phantom Parameter is not coming from leftovers in Sorting and
Grouping - that was the first place I looked... Thanks again, in advance for
any help you can give!

Matt
 
A

Allen Browne

Could it be in the report's Filter or OrderBy property?

If the report is based on a query, does the query ask for the parameter?
 
G

Guest

The query does not have any parameters, and unfortunately, the report is
using neither the Filter nor Order By properties. Thanks though - definitely
a good thought!

Matt
 
A

Allen Browne

Have you unchecked the Name AutoCorrect boxes under:
Tools | Options | General
Then compact the database.
I have seen cases where Access "remembers" what it thinks is the previous
name of a field.

Another option would be to export the report to a text file, using the
undocumented:
SaveAsText acReport, "Report1", "C:\Report1.txt"
Then search the text file to see what the name is associated with.

That's probably more efficient that the built-in documenter:
Tools | Analyze | Documenter
 
G

Guest

I had done neither of those, so I gave them both a try. Unfortunately,
compacting and repairing did not remove the glitch, and a search of that text
document revealed nothing. Thanks for the SaveAsText command though - I
hadn't seen it, and it would have been most useful a couple months ago. Any
other thoughts? Since the parameter does not seem to be coming from any of
the controls on the report, I'm thinking about creating a new, blank report
and copying the controls over by hand, but I'd really rather not do that...

Matt
 
A

Allen Browne

It's got to be there somewhere, Matt, even if it's embedded in or returned
by another expression, e.g.:
=DLookup(DLookup("WhatField", "Table1"), "Table2")

If the report has a module, you could try setting its HasModule to No to
dump that.

If you want to try re-creating the report from the file you exported, the
matching command is LoadFromText.
 
G

Guest

I agree that it's got to be here somewhere, but I'm sure not finding it.
Reloading from text into a new report maintains the phantom parameter
behavior. If you would like, I can send you the text file... I'm wondering if
the parameter is somehow contained in a hex code somewhere, like the NameMap.
If it is, I don't know how to decode that, since they seem to be pointers of
some sort...

Matt
 
A

Allen Browne

Matt, email me a cutdown of your database, by creating a new mdb and
importing just the report and any tables, queries, user-defined functions it
uses. A couple of records will be fine if the data is sensitive. Compact.
Zip.

Include the contents of this thread in the email.

You can't just reply to this thread, as my email address is munged to stop
spam. Use the address spelled out in the sig below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top