filter report by using a form

H

Hugo Brouwer

I like to open a report by using a form, on this form i wanted to set a
filter by indepentend pulldown field

One criteria is no problem, but when i have two criteria or pull down field
i get allerts

Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String

stDocName = Me![Rapportnaam]

stLinkCriteria1 = "[tbl General]![DistributionpanelId]=" &
Me![DistributionpanelId]
stLinkCriteria2 = "[tbl General]![LocationId]=" & Me![LocationId]
stLinkCriteria = stLinkCriteria1 And stLinkCriteria2

DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria

Who can solve my problem,

Thanks

Hugo
 
F

fredg

I like to open a report by using a form, on this form i wanted to set a
filter by indepentend pulldown field

One criteria is no problem, but when i have two criteria or pull down field
i get allerts

Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String

stDocName = Me![Rapportnaam]

stLinkCriteria1 = "[tbl General]![DistributionpanelId]=" &
Me![DistributionpanelId]
stLinkCriteria2 = "[tbl General]![LocationId]=" & Me![LocationId]
stLinkCriteria = stLinkCriteria1 And stLinkCriteria2

DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria

Who can solve my problem,

Thanks

Hugo

stLinkCriteria = stLinkCriteria1 & " And " & stLinkCriteria2
 

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