Report Help

A

Ayo

I have a report that is generated using the following codes:
If Me.fraReportOption.Value = 1 Then
DoCmd.OpenReport "rpt_SiteConfiguration_UMTS", acViewNormal,
"qry_SiteConfiguration_UMTS", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
ElseIf Me.fraReportOption.Value = 2 Then
DoCmd.OpenReport "rpt_SiteConfiguration_UMTS", acViewPreview,
"qry_SiteConfiguration_UMTS", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""

End If

My problem is that when the report is displayed it has two pages ofthe same
thin instead of just the one page. Any ideas?
Thanks.
 
L

Larry Linson

(1) Value is the default property of a Control, so you can use

If Me.fraReportOption = 1 Then

(2) You do not need to use both the "Filter" and the "WhereCondition"
arguments in DoCmd.OpenReport -- use one or the other. I don't know if that
might be what's causing your duplicate data, but try removing the Filter
property and let us know.

Larry Linson
Microsoft Office Access MVP
 
T

Tom Wickerath

Hi Ayo,

One possibility is that your query, "qry_SiteConfiguration_UMTS", is
producing what is known as a Cartesian Product result. A Cartesian product
results when you have more than one source table (or query) in the query
design view, and there is no join between these tables. In that case, you
will get the product of the number of records selected from each table.

Try running your query by itself, with the appropriate criteria. Do you see
totally duplicate records in the recordset?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
A

Ayo

Removing the filter didn't fit the problem. I tried that already.

Larry Linson said:
(1) Value is the default property of a Control, so you can use

If Me.fraReportOption = 1 Then

(2) You do not need to use both the "Filter" and the "WhereCondition"
arguments in DoCmd.OpenReport -- use one or the other. I don't know if that
might be what's causing your duplicate data, but try removing the Filter
property and let us know.

Larry Linson
Microsoft Office Access MVP

Ayo said:
I have a report that is generated using the following codes:
If Me.fraReportOption.Value = 1 Then
DoCmd.OpenReport "rpt_SiteConfiguration_UMTS", acViewNormal,
"qry_SiteConfiguration_UMTS", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
ElseIf Me.fraReportOption.Value = 2 Then
DoCmd.OpenReport "rpt_SiteConfiguration_UMTS", acViewPreview,
"qry_SiteConfiguration_UMTS", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""

End If

My problem is that when the report is displayed it has two pages ofthe
same
thin instead of just the one page. Any ideas?
Thanks.
 
A

Ayo

There is only one table in the query.

Tom Wickerath said:
Hi Ayo,

One possibility is that your query, "qry_SiteConfiguration_UMTS", is
producing what is known as a Cartesian Product result. A Cartesian product
results when you have more than one source table (or query) in the query
design view, and there is no join between these tables. In that case, you
will get the product of the number of records selected from each table.

Try running your query by itself, with the appropriate criteria. Do you see
totally duplicate records in the recordset?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

Ayo said:
I have a report that is generated using the following codes:
If Me.fraReportOption.Value = 1 Then
DoCmd.OpenReport "rpt_SiteConfiguration_UMTS", acViewNormal,
"qry_SiteConfiguration_UMTS", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
ElseIf Me.fraReportOption.Value = 2 Then
DoCmd.OpenReport "rpt_SiteConfiguration_UMTS", acViewPreview,
"qry_SiteConfiguration_UMTS", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""

End If

My problem is that when the report is displayed it has two pages ofthe same
thin instead of just the one page. Any ideas?
Thanks.
 
T

Tom Wickerath

Hi Ayo,

You removed the optional filter agrument from your VBA code? Or, did you
simply open the report in design view and remove an existing filter?

Please show the latest version of your code.


From your other reply:
There is only one table in the query.

Is your query returning the correct number of records, or are you seeing the
duplicates there too?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
A

Ayo

This is what I have now
Private Sub cmdGSMConfig_Click()

If MessageText <> "" Then
With Me.lblMsg
.Caption = MessageText
.ForeColor = 255
Exit Sub
End With
End If

If Me.fraReportOption = 1 Then
DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewNormal,
"qry_SiteConfiguration_GSM", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
ElseIf Me.fraReportOption = 2 Then
DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewPreview, , _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='"
& Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
End If
End Sub
 
T

Tom Wickerath

Hi Ayo,
This is what I have now
<snip, with the DoCmd.OpenReport line slightyly re-written, but essentially
the same, (I think)>

DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewNormal, _
"qry_SiteConfiguration_GSM", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And [ProjectName]='"
& _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""

It looks like you are still supplying the optional FilterName
("qry_SiteConfiguration_GSM") AND WhereCondition arguments. Larry's advice
earlier was to try using one or the other, but not both.

How about the second question I asked you? This read: "Is your query
returning the correct number of records, or are you seeing the duplicates
there too?"

If the answer to the above is no duplicates in the query, then I invite you
to send me a copy of your database, if you are able to do this. You can
delete any sensitive data, adding back in just enough dummy data to allow you
to reproduce the problem at hand. Let me know if you are interested in
pursuing this option.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

Ayo said:
This is what I have now
Private Sub cmdGSMConfig_Click()

If MessageText <> "" Then
With Me.lblMsg
.Caption = MessageText
.ForeColor = 255
Exit Sub
End With
End If

If Me.fraReportOption = 1 Then
DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewNormal,
"qry_SiteConfiguration_GSM", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
ElseIf Me.fraReportOption = 2 Then
DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewPreview, , _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='"
& Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
End If
End Sub

Tom Wickerath said:
Hi Ayo,

You removed the optional filter agrument from your VBA code? Or, did you
simply open the report in design view and remove an existing filter?

Please show the latest version of your code.


From your other reply:

Is your query returning the correct number of records, or are you seeing the
duplicates there too?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
A

Ayo

I can send you the database. There are no sensitive data in there yet. Where
do I sent it?

Tom Wickerath said:
Hi Ayo,
This is what I have now
<snip, with the DoCmd.OpenReport line slightyly re-written, but essentially
the same, (I think)>

DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewNormal, _
"qry_SiteConfiguration_GSM", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And [ProjectName]='"
& _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""

It looks like you are still supplying the optional FilterName
("qry_SiteConfiguration_GSM") AND WhereCondition arguments. Larry's advice
earlier was to try using one or the other, but not both.

How about the second question I asked you? This read: "Is your query
returning the correct number of records, or are you seeing the duplicates
there too?"

If the answer to the above is no duplicates in the query, then I invite you
to send me a copy of your database, if you are able to do this. You can
delete any sensitive data, adding back in just enough dummy data to allow you
to reproduce the problem at hand. Let me know if you are interested in
pursuing this option.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

Ayo said:
This is what I have now
Private Sub cmdGSMConfig_Click()

If MessageText <> "" Then
With Me.lblMsg
.Caption = MessageText
.ForeColor = 255
Exit Sub
End With
End If

If Me.fraReportOption = 1 Then
DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewNormal,
"qry_SiteConfiguration_GSM", _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='" & _
Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
ElseIf Me.fraReportOption = 2 Then
DoCmd.OpenReport "rpt_SiteConfiguration_GSM", acViewPreview, , _
Wherecondition:="[SiteID]='" & Me.cmbSiteID & "' And
[ProjectName]='"
& Me.cmbProjectName & "' And [RevNumber]=" & Me.cmbRevNumber & ""
End If
End Sub

Tom Wickerath said:
Hi Ayo,

You removed the optional filter agrument from your VBA code? Or, did you
simply open the report in design view and remove an existing filter?

Please show the latest version of your code.


From your other reply:
There is only one table in the query.

Is your query returning the correct number of records, or are you seeing the
duplicates there too?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

Removing the filter didn't fit the problem. I tried that already.

:

(1) Value is the default property of a Control, so you can use

If Me.fraReportOption = 1 Then

(2) You do not need to use both the "Filter" and the "WhereCondition"
arguments in DoCmd.OpenReport -- use one or the other. I don't know if that
might be what's causing your duplicate data, but try removing the Filter
property and let us know.

Larry Linson
Microsoft Office Access MVP
 
T

Tom Wickerath

Hi Ayo,

Scroll down towards the bottom of this page:
http://www.access.qbuilt.com/html/expert_contributors.html

Here, you should see an e-mail address for me. I don't want to reply with my
e-mail address here, because spammers have software that can harvest e-mail
addresses from newsgroup postings. So please don't post your e-mail address
(or mine) to a newsgroup reply.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

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