473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Filter

[b]i have a form with three Option groups and one combo box and i am trying to filter it out to the subform that i have on the same form. here is the code, everytime i try to click on Apply Filter. its not working. my filter is not showing on the subform.


Dim strmarket As String
Dim stradvertisers As String
Dim strheading As String
Dim strudac As String
Dim strfilter As String


If IsNull(Me.txtmarket.Value) Then
strmarket = "Like '*'"
Else
Select Case Me.fraMarket.Value
Case 1
strmarket = "Like '" & Me.txtmarket.Value & "*'"
Case 2
strmarket = "Like '*" & Me.txtmarket.Value & "*'"
Case 3
strmarket = "Like '*" & Me.txtmarket.Value & "'"
Case 4
strmarket = "= '" & Me.txtmarket.Value & "'"
End Select
End If



If IsNull(Me.txtAdvertisers.Value) Then
stradvertisers = "Like '*'"
Else
Select Case Me.fraAdvertisers.Value
Case 1
stradvertisers = "Like '" & Me.txtAdvertisers.Value & "*'"
Case 2
stradvertisers = "Like '*" & Me.txtAdvertisers.Value & "*'"
Case 3
stradvertisers = "Like '*" & Me.txtAdvertisers.Value & "'"
Case 4
stradvertisers = "= '" & Me.txtAdvertisers.Value & "'"
End Select
End If



If IsNull(Me.TxtHeading.Value) Then
strheading = "Like '*'"
Else
Select Case Me.FraHeading.Value
Case 1
strheading = "like '" & Me.TxtHeading.Value & "*'"
Case 2
strheading = "Like '*" & Me.TxtHeading.Value & "*'"
Case 3
strheading = "Like '*" & Me.TxtHeading.Value & "'"
Case 4
strheading = Me.TxtHeading.Value & ""
End Select
End If


If IsNull(Me.CboUDAC.Value) Then
strudac = "like '*'"
Else
strudac = "='" & Me.CboUDAC.Value & "'"
End If

strfilter = "[market] " & strmarket & " and [advertisers] " & stradvertisers & " and [heading]" & strheading


With SubForm![frmMeterAdSubform]
.filter = strfilter
.FilterOn = True

End With


End sub

:confused:
May 17 '06 #1
0 1221

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

Similar topics

9
by: Robin Cull | last post by:
Imagine I have a dict looking something like this: myDict = {"key 1": , "key 2": , "key 3": , "key 4": } That is, a set of keys which have a variable length list of associated values after...
1
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
8
by: dick | last post by:
I am just trying to print/report the results of a "filter by selection" which is done by right-clicking a form, filling in values, and "applying the filter." I have searched the newsgroups, and...
2
by: Salad | last post by:
I have a log file with a list of records. The log file can be unfiltered or filtered. I have a command button to call a data entry form from the log. At first I was only going to present the...
2
by: Mike Sweetman | last post by:
I have a form Form1 which when the Advanced Filter/Sort is used creates a form(maybe) with a title 'Form1Filter1 : Filter'. When I apply the filter to Form1 it is applied, but the value of...
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
15
by: Briansmi1116 | last post by:
I created two buttons, that filter my form, They filter in different Fields, and if one is filtered, and the other is not there is a certain amount of record, if they are both pushed, then there is...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.