473,756 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Filter

A2003, XP Pro SP2.

I'm developing a simple custom filter form for a client and keep running
into the same error. I've posted a simplified version in my web space at

http://keith.wilby.users.btopenworld.com/dbase/db4.zip

Try this:

Open frmTest, then open fdlgFilter.
Select DateType from the first field list combo then select a value in
the value list combo. Apply the filter - it works!
Now unhide fdlgFilter and change the field selected to TextType then try
to select a value. See the error? "The value you entered isn't valid
....", so the combo on the right still thinks its data type is "Date".

I'm sure that, like me, this is going to be something simple and daft
but I just can't fathom what. Any help or pointers greatly appreciated
as always.

Regards,
Keith.
Nov 13 '05 #1
7 3026
"Keith" <ke***@NOCARPke ithwilby.org.uk > wrote in message
news:d8******** **@nwrdmz01.dmz .ncs.ea.ibs-infra.bt.com...
A2003, XP Pro SP2.

I'm developing a simple custom filter form for a client and keep running
into the same error. I've posted a simplified version in my web space at

http://keith.wilby.users.btopenworld.com/dbase/db4.zip

Try this:

Open frmTest, then open fdlgFilter.
Select DateType from the first field list combo then select a value in the
value list combo. Apply the filter - it works!
Now unhide fdlgFilter and change the field selected to TextType then try
to select a value. See the error? "The value you entered isn't valid ...",
so the combo on the right still thinks its data type is "Date".

I'm sure that, like me, this is going to be something simple and daft but
I just can't fathom what. Any help or pointers greatly appreciated as
always.

Regards,
Keith.

If you set the recordsource of the combo to:
SELECT "" AS X FROM MSysObjects WHERE 1=0
when you are in design view, this may rid you of this immediate problem,
telling the combobox to expect text. Just make sure you're careful around
sql strings, dates and regional settings.

I guess you are ultimately going somewhere where the built in filter-by-form
functionality can't be used, but it's extremely flexible, tested and
hopefully bug-free.
Nov 13 '05 #2
Justin Hoffman wrote:

If you set the recordsource of the combo to:
SELECT "" AS X FROM MSysObjects WHERE 1=0
when you are in design view, this may rid you of this immediate problem,
telling the combobox to expect text. Just make sure you're careful around
sql strings, dates and regional settings.

I guess you are ultimately going somewhere where the built in filter-by-form
functionality can't be used, but it's extremely flexible, tested and
hopefully bug-free.

I can't thank you enough for this Justin, you're a star! I don't
suppose you could explain exactly why this fix works?

I've tried to persuade my client to use filter-by-form but he's quite
adamant that this is what his company wants.

Regards,
Keith.
Nov 13 '05 #3
Why are you binding the filter form to the table?

Nov 13 '05 #4
Ozzone wrote:
Why are you binding the filter form to the table?

In the "real" one I'm not, I'm just trying to replicate the error with
this. In the actual app the filter form's record source is Forms(0)
because only one form will be open at any given time. Why do you ask?
Nov 13 '05 #5
"Keith" <ke***@NOCARPke ithwilby.org.uk > wrote in message
news:d8******** **@nwrdmz03.dmz .ncs.ea.ibs-infra.bt.com...
Justin Hoffman wrote:

If you set the recordsource of the combo to:
SELECT "" AS X FROM MSysObjects WHERE 1=0
when you are in design view, this may rid you of this immediate problem,
telling the combobox to expect text. Just make sure you're careful
around sql strings, dates and regional settings.

I guess you are ultimately going somewhere where the built in
filter-by-form functionality can't be used, but it's extremely flexible,
tested and hopefully bug-free.

I can't thank you enough for this Justin, you're a star! I don't suppose
you could explain exactly why this fix works?

I've tried to persuade my client to use filter-by-form but he's quite
adamant that this is what his company wants.

Regards,
Keith.

Hi Keith
All this does is create a query based on a system table which returns no
rows and is only one field wide. In fact you could have used any table to
replace MSysObjects in the query, the point is that the calculated field (X)
is text and so right from the start the combobox is not expecting any
special format (like numbers or dates). It will accept anything provided it
can be represented as text - and afterall - what can't?
Of course the customer is always right and all that, but since you already
have a fixed number of comboboxes, I would be tempted to fix the fields they
represent. Normally when I build something like this I would have, say the
SomeDate field shown in a fixed position on that form. It allows me to have
special functions (like having a 'Today' button or showing a calendar)
dedicated to selecting from this particular field. You also might have
txtFromDate and txtToDate for date criteria whereas for other fields a
single control may be all that's required, eg chkSendNoEmail.
Nov 13 '05 #6
Just wondering is all. Justin offered a good solution.

Nov 13 '05 #7
"Justin Hoffman" <j@b.com> wrote in message
news:d8******** **@nwrdmz01.dmz .ncs.ea.ibs-infra.bt.com...
All this does is create a query based on a system table which returns no
rows and is only one field wide. In fact you could have used any table to
replace MSysObjects in the query, the point is that the calculated field
(X) is text and so right from the start the combobox is not expecting any
special format (like numbers or dates). It will accept anything provided
it can be represented as text - and afterall - what can't?
It seems so obvious now you've explained it, many thanks.
Of course the customer is always right and all that, but since you already
have a fixed number of comboboxes, I would be tempted to fix the fields
they represent. Normally when I build something like this I would have,
say the SomeDate field shown in a fixed position on that form. It allows
me to have special functions (like having a 'Today' button or showing a
calendar) dedicated to selecting from this particular field. You also
might have txtFromDate and txtToDate for date criteria whereas for other
fields a single control may be all that's required, eg chkSendNoEmail.

All good suggestions but I think the idea is to have this form used by
whatever main form is opened at the time, hence the data source in the
'real' app is that for Forms(0).

Once again Justin, many thanks for helping me out on this one.

Keith.
Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3035
by: Keith | last post by:
A2003, XP Pro. I'm in the middle of designing a form to act as a custom filter, like a very basic 'filter by form'. It has two sets of combos, those on the left are to choose the field name(s) on which to filter, those on the right to choose the value(s) from the chosen field(s). The idea is to build up a dynamic SQL string on which to filter the recordset. I thought I'd be able to overcome the data type issue by using CStr() in the...
1
7165
by: Erik | last post by:
I have a base collection class that I use to derive all my collections from. It derives from CollectionBase. I have added custom Sorting and now would like to add Filtering. I have spent a decent amount of time looking thru code and really have not found anything that suits my needs. I simply want to pass in a filter expression use that that expression against the protected List (exposed by CollectionBase) object and return an array list...
0
1758
by: Cybermedia Marketing | last post by:
I'm trying to convert an ISAPI filter to an httpmodule. The ISAPI filter added custom headers to the response which could later be accessed by the asp page. ISAPI Filter: pvPrep->SetHeader(pfc, "Instance-Id:", info->instance_id); pvPrep->SetHeader(pfc, "Company-Id:", info->company_id); pvPrep->SetHeader(pfc, "Primary:", info->hostname); pvPrep->SetHeader(pfc, "Profile:", buffer);
2
4978
by: Boris Condarco | last post by:
Hi gurus, I was reading some documentation about security in .NET Framework, it mention that it is possible to make custom Role Based security for example: check the authentication with Windows Integrated and once do that, create a Generic Identity in orde to create a Generic Principal with custom roles for that user. Finally, replace the current Principal to the new Generic Principal. Is it possible to do this in an ASP.NET...
0
2516
by: RyanG | last post by:
when the value that determines the filter is databound?? I am trying to make a DropDownList for a set of data that I use a lot throughout my project. So I extended the DropDownList to retrieve from the database a set of data to populate the itself with. Now to make this control as reusable as possible I also added a new property to this Custom DropDownList. With the goal being that this property would be used with the DataView...
2
2769
by: Raf256 | last post by:
Hello, my custom streambuf works fine with output via << and with input via .get() but fails to input via >> or getline... any idea why? -------------------- A custom stream buffer (for encryption, currently it is doing "nothing")
3
1865
by: Shawn Ramirez | last post by:
As with most web applications speed is a huge deal to me in my applications. My customers don't really care if my app is a true 3 tier application or not, they just want it to be faster then it was yesterday. Because of this I try to limit my calls to the database by using a loading lookup data for a customer and then filtering down to what I need. (I have alot of recursive logic because of alot of tree controls). Here is my question. ...
3
1552
by: gibsonsgman | last post by:
hello, i am having an issue with a filter. What I want to do is filter out all of the dates that have past and are not within a certain time period. This time period is seleced from a combo box. Here is the code I am attempting to use. Dim D1 As Date Dim D2 As Date Dim T As Integer Dim stfilter As String D1 = Date
2
1621
by: Josh Naro | last post by:
I am writing a module that requires the entire output from a web app to perform its function. So, basically I need to be able to pull the entire output stream from the Response object. I've tried attaching a custom filter to Response.Filter, but the custom filter receives the stream in separate chunks. I need the entire stream at once in order to convert it to an XmlDocument. Does anyone know of a way to get the entire output stream from a...
0
9255
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,...
0
10014
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9689
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
7226
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
6514
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
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3780
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2647
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.