472,135 Members | 1,230 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,135 software developers and data experts.

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 1588
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.