473,395 Members | 1,541 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,395 software developers and data experts.

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 2994
"Keith" <ke***@NOCARPkeithwilby.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***@NOCARPkeithwilby.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
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)...
1
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...
0
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: ...
2
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...
0
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...
2
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...
3
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...
3
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. ...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.