469,913 Members | 2,129 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,913 developers. It's quick & easy.

Dynamic report

14
Hi,

I want to create a dynamic report and for that I'm using a very simple Combo Box (only one item) and I want to use this filter on my report. Here's the code I came up with:

Private Sub Enter_Click()
Dim strSite_Name As String
Dim strEnter As String

If IsNull(Me.cboSite_Name.Value) Then
strSite_Name = "Like '*' "
Else: strSite_Name = "='" & Me.cboSite_Name.Value & "'"
End If


With Reports![rptScoring]
.Filter = strEnter
.FilterOn = True
End With
End Sub

My report is open but if I press enter, absolutely nothing happens... so now I'm confused, what do I do wrong???

Marie
Jul 31 '07 #1
2 1466
zoro25
14
Ok, I figured out most of my issues, the code works fine if my filtering item is a primary key, if not, it doesn't work. Any idea why?

Thanks

Marie
Aug 1 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Ok, I figured out most of my issues, the code works fine if my filtering item is a primary key, if not, it doesn't work. Any idea why?

Thanks

Marie
You have declared two variables strSite_Name and strEnter

you set the filter value to the first and set the filter to run on the second which is empty
Aug 6 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Nathan Bloomfield | last post: by
reply views Thread by CSDunn | last post: by
3 posts views Thread by deejayquai | last post: by
2 posts views Thread by deejayquai | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.