Passing parameters

M

Morisatwork

Hi

I wonder is someone can help me re two aspects of the code below

Firstly I have a report that is based on a table (shopstats) and I am
using a form to pass the certain parameters.

strWhereCondition = "[ShopStats].[Survey] = '" & Me.cbSurvey & "'"
If cbShop "" Then
strWhereCondition = strWhereCondition & " AND [shopstats].[shop]
='" & Me.cbShop & "'"
End If


stDocName = "rptShopStats"

DoCmd.OpenReport stDocName, acPreview, , strWhereCondition

When the above code is run, and at the moment I am only passing the
Survey code ([shopstats].[survey]), a popup appears prompting for
shopstats.survey.

I have used the above in other forms/reports and they work.

What am i doing wrong? What should I be looking for?

My second query is that I want to create a summary report and want to
hide the following bands on the report. Is this the right code

'If Check12 = True Then
' rptshopstats.GroupHeader0.Visible = False
' rptshopstate.GroupFooter1.Visible = False
'End If
 
M

Morisatwork

Disregard as I have resolved my silliness to why the pop up

Though would like answer to second part re disabling certain bands

Thanks

Moris
Hi

I wonder is someone can help me re two aspects of the code below

Firstly I have a report that is based on a table (shopstats) and I am
using a form to pass the certain parameters.

strWhereCondition = "[ShopStats].[Survey] = '" & Me.cbSurvey & "'"
If cbShop "" Then
strWhereCondition = strWhereCondition & " AND [shopstats].[shop]
='" & Me.cbShop & "'"
End If


stDocName = "rptShopStats"

DoCmd.OpenReport stDocName, acPreview, , strWhereCondition

When the above code is run, and at the moment I am only passing the
Survey code ([shopstats].[survey]), a popup appears prompting for
shopstats.survey.

I have used the above in other forms/reports and they work.

What am i doing wrong? What should I be looking for?

My second query is that I want to create a summary report and want to
hide the following bands on the report. Is this the right code

'If Check12 = True Then
' rptshopstats.GroupHeader0.Visible = False
' rptshopstate.GroupFooter1.Visible = False
'End If
 

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