473,804 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter in Access Data Page

3 New Member
Hi,

I am programming a multi-criteria filter in an Access Data Page. I successed to make a simple criteria filter using the code below:

(the code is on a button click action)

Expand|Select|Wrap|Line Numbers
  1. MSODSC.DataPages(0).Filter = "Status= '" & SSTATUS.value & "'" 
  2.  
  3.     If MSODSC.DataPages(0).IsFilterOn then
  4.         ' If the filter is on, turn it off.
  5.         MSODSC.DataPages(0).IsFilterOn = false
  6.     else
  7.         ' Otherwise, turn it back on.
  8.         MSODSC.DataPages(0).IsFilterOn = true
  9.     end if
  10.  
Now, I'm trying to make a 2 criteria Filter. I tried the code below but it doesn't work, I get: Type mismatch: '[string: "Status= 'New'"]' when I use the button to filter.


Expand|Select|Wrap|Line Numbers
  1. MSODSC.DataPages(0).Filter = "Status= '" & SSTATUS.value & "'" and "Related= '" & SRELATED.value & "'"
  2.  
  3.     If MSODSC.DataPages(0).IsFilterOn then
  4.         ' If the filter is on, turn it off.
  5.         MSODSC.DataPages(0).IsFilterOn = false
  6.     else
  7.         ' Otherwise, turn it back on.
  8.         MSODSC.DataPages(0).IsFilterOn = true
  9.     end if
  10.  
Does someone know why I get this error?

Thanks a lot for your help and if you need more information please let me know.
Jul 31 '07 #1
3 1848
remdeb648
3 New Member
No one have an idea how to solve this problem?

I really need your help...
Jul 31 '07 #2
jhardman
3,406 Recognized Expert Specialist
is this ASP.NET?

Jared
Aug 2 '07 #3
remdeb648
3 New Member
Sorry but I have no idea...
Aug 8 '07 #4

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

Similar topics

2
10056
by: Sanders | last post by:
I inherited an Access database and I have not worked with Access for very long. I have a Form that goes through a bunch of different queries until it spits out a datasheet with all kinds of information from different tables, calculated fields etc. I need to filter the data by workers projects and then sort the remainding data. I am not sure if I can do this in the query to the data sheet or if I have to update the form. I think the...
1
7853
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 from queries. Let me just add that Allen Browne excellent article about this subject may not apply to this scenario on an elementary level. (Here's the link to the article; Filter a Form on a Field in a Subform -...
0
6476
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 report are based on the same View addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides in a SQL Server 2000 database. There are two different problems I am having with filtering: The first involves filtering in the form by date...
7
6292
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals. I can do this the first time the form loads.
8
6537
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 there are many examples. BUT, they fail sometimes. The techique is to pass the form's Me.filter as the "where condition" in a Docmd.openreport statement in code behind a "print button" on the form.
2
5069
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 record the user selected. Then I thought, what the heck, give the user all of them but start out at the record the user is currently on. If I pass the current filter that resides on the log this causes problems. For example, if the filter is...
3
2483
by: Brad | last post by:
I have a response filter which injects "standard" html into my pages. The filter works fine when the initial stream is small enough not to buffer...or....if I have a large unbuffered stream (i.e. I set buffer=false on a large page). Now the problem: If I turn on buffering on a large page, the page output (to the browser) is correct a few times (sometines just once, sometime 2-3 times...on the same page) then I seem to either lose data...
3
2019
by: Soulspike | last post by:
Form name to filter = frmSortFor Filter based on list box from frmTest= lstSortFor Form containing list box = frmTest Field (CompCodes) data format = "PM SM TS EW WA" I have a database that I want to filter a form (frmSortFor) useing the field (CompCodes). I need to find the records that match any of the 2 letter codes that I select on the list box. When i use the code listed below i get an runtime error : "Microsoft Access can't...
5
3686
by: Jim Mandala | last post by:
Using Access 2003 front end; SQL Server 2005 Back end: I have a complex form that has lots of data fields including about thirty or so checkboxes storing Yes/No data that I would like my users to be able to use the Filter by Form functionality with to create a "Custom" query. This works perfectly fine when I filter on a text field. Also, this works perfectly fine for all data with an Access Back end. When I use boolean data and my SQL...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.