I don't have any parameters, yet they show up

  • Thread starter gmazza via AccessMonster.com
  • Start date
G

gmazza via AccessMonster.com

Hey there,
I do not have a parameter report, yet when I run my report I get 4 parameters
show up. The first one says Enter a Parameter value as the title of the
window, and it says 3 in the window. If I ok it, then a new parameter window
shows up and says 2, I ok that, then 0, then 1, then a blank report.
Why would a parameter show up when I don't have a parameter form?

Any help is appreciated.
Thanks!
 
K

KARL DEWEY

says Enter a Parameter value as the title of thewindow,
That is a new one on me.

What is the title of the window? Does it relate to anything else by name?

Post the SQL of the query feeding the report.
 
G

gmazza via AccessMonster.com

Thanks for your reply Karl.
The title of the window is Enter Parameter Value.
The report is based on a table, no query, however, I have some stuff in the
On Open event of the report I will post.
Before I post the code, let me explain a bit.
I have 399 text boxes on my report, I am grabbing specific values from a
table and displaying them on the report in each of the textboxes, assuming
there is data in the table to fill the textboxes.
I tested the code, I debugged the whole thing, the values are being grabbed
correctly with the DLookup, I just keep getting these parmeter windows before
the report opens.
If I enter the number 8 or 9 as a parameter value, my report shows up with
8's or 9's as the values of all the text boxes so its really weird.
If you want a copy of the database I can send you one, its super tiny.
Anyway, thanks for your oncoming help!

Dim Day As String
Dim ValueCount As Integer
Dim DayCount As Integer
Dim TotalCount As Integer

Set rs = CurrentDb.OpenRecordset("Select * from Assessment where
ClinicalTrialId = '" & study & "'" & _
" and WeekId = '" & [Forms]![patient]![txtWeek] & "' and PatientId = '" &
GetActivePatient() & "'")

If rs.RecordCount > 0 Then
rs.MoveFirst
Do While Not rs.EOF

For Each fld In rs.Fields
TotalCount = 0

If fld.Name = "DayId" Then
If IsNull(fld.Value) Then
Else
Day = fld.Value

DayCount = DayCount + 1
ValueCount = DayCount

While TotalCount < 57
TotalCount = TotalCount + 1

Me.Controls("text" & ValueCount).ControlSource = Nz(DLookup("Value" &
TotalCount, "Assessment", "WeekId = '" & [Forms]![patient]![txtWeek] & _
"' and PatientId = '" & GetActivePatient() & "' and DayId = '" & Day & "' and
ClinicalTrialId = '" & GetActiveStudy() & "'"))

ValueCount = ValueCount + 7

Wend

End If
End If

Next fld
rs.MoveNext
Loop

End If

Set fld = Nothing
rs.Close
Set rs = Nothing

LabelCount = LabelCount * 7

While LabelCount < 399
LabelCount = LabelCount + 1
Me.Controls("Text" & LabelCount).Visible = False
Wend


KARL said:
That is a new one on me.

What is the title of the window? Does it relate to anything else by name?

Post the SQL of the query feeding the report.
Hey there,
I do not have a parameter report, yet when I run my report I get 4 parameters
[quoted text clipped - 5 lines]
Any help is appreciated.
Thanks!
 
K

KARL DEWEY

Why would a parameter show up when I don't have a parameter form?
You do not have to have a 'form' for it to ask for parameter.
You have this in your code twice --
[Forms]![patient]![txtWeek]
so it ask for input.

--
Build a little, test a little.


gmazza via AccessMonster.com said:
Thanks for your reply Karl.
The title of the window is Enter Parameter Value.
The report is based on a table, no query, however, I have some stuff in the
On Open event of the report I will post.
Before I post the code, let me explain a bit.
I have 399 text boxes on my report, I am grabbing specific values from a
table and displaying them on the report in each of the textboxes, assuming
there is data in the table to fill the textboxes.
I tested the code, I debugged the whole thing, the values are being grabbed
correctly with the DLookup, I just keep getting these parmeter windows before
the report opens.
If I enter the number 8 or 9 as a parameter value, my report shows up with
8's or 9's as the values of all the text boxes so its really weird.
If you want a copy of the database I can send you one, its super tiny.
Anyway, thanks for your oncoming help!

Dim Day As String
Dim ValueCount As Integer
Dim DayCount As Integer
Dim TotalCount As Integer

Set rs = CurrentDb.OpenRecordset("Select * from Assessment where
ClinicalTrialId = '" & study & "'" & _
" and WeekId = '" & [Forms]![patient]![txtWeek] & "' and PatientId = '" &
GetActivePatient() & "'")

If rs.RecordCount > 0 Then
rs.MoveFirst
Do While Not rs.EOF

For Each fld In rs.Fields
TotalCount = 0

If fld.Name = "DayId" Then
If IsNull(fld.Value) Then
Else
Day = fld.Value

DayCount = DayCount + 1
ValueCount = DayCount

While TotalCount < 57
TotalCount = TotalCount + 1

Me.Controls("text" & ValueCount).ControlSource = Nz(DLookup("Value" &
TotalCount, "Assessment", "WeekId = '" & [Forms]![patient]![txtWeek] & _
"' and PatientId = '" & GetActivePatient() & "' and DayId = '" & Day & "' and
ClinicalTrialId = '" & GetActiveStudy() & "'"))

ValueCount = ValueCount + 7

Wend

End If
End If

Next fld
rs.MoveNext
Loop

End If

Set fld = Nothing
rs.Close
Set rs = Nothing

LabelCount = LabelCount * 7

While LabelCount < 399
LabelCount = LabelCount + 1
Me.Controls("Text" & LabelCount).Visible = False
Wend


KARL said:
says Enter a Parameter value as the title of thewindow,
That is a new one on me.

What is the title of the window? Does it relate to anything else by name?

Post the SQL of the query feeding the report.
Hey there,
I do not have a parameter report, yet when I run my report I get 4 parameters
[quoted text clipped - 5 lines]
Any help is appreciated.
Thanks!

--



.
 
G

gmazza via AccessMonster.com

Thanks for your reply!
So how do I get the vaue of txtWeek then without using Forms!

KARL said:
You do not have to have a 'form' for it to ask for parameter.
You have this in your code twice --
[Forms]![patient]![txtWeek]
so it ask for input.
Thanks for your reply Karl.
The title of the window is Enter Parameter Value.
[quoted text clipped - 81 lines]
 
G

gmazza via AccessMonster.com

I took both instances of [Forms]![patient]![txtWeek] out of my code and
tested it using 1 as my Week and I still get it asking for a parameter. What
else could it be?

KARL said:
You do not have to have a 'form' for it to ask for parameter.
You have this in your code twice --
[Forms]![patient]![txtWeek]
so it ask for input.
Thanks for your reply Karl.
The title of the window is Enter Parameter Value.
[quoted text clipped - 81 lines]
 
G

gmazza via AccessMonster.com

It is in this statement because if I comment this out then there is no
parameter coming up. Course the report's fields have no control source and
they all show an error so I need this in there:

Me.Controls("text" & ValueCount).ControlSource = Nz(DLookup("Value" &
TotalCount, "Assessment", "WeekId = '" & Week & _
"' and PatientId = '" & GetActivePatient() & "' and DayId = '" & Day & "' and
ClinicalTrialId = '" & GetActiveStudy() & "'"))


KARL said:
You do not have to have a 'form' for it to ask for parameter.
You have this in your code twice --
[Forms]![patient]![txtWeek]
so it ask for input.
Thanks for your reply Karl.
The title of the window is Enter Parameter Value.
[quoted text clipped - 81 lines]
 

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