473,657 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a continuious form to search - coding problems

hi group,

I am using a continuous form and filters to make a user-friendly search
form. But the filter is being applied, and I'm also getting a
parameter box that pops up- so the filter isn't even using the form. I
think its a problem in my coding, which is pasted below. Any help is
greatly appreciated! Thanks!

rivate Sub cmdFilter_Click ()

Dim strWhere As String 'The criteria string.
Dim lngLen As Long 'Length of the criteria
string to append to.
Const conJetDate = "\#mm\/dd\/yyyy\#" 'The format expected for
dates in a JET query string.
'************** *************** *************** *************** ************
'************** *************** *************** *************** ************
If Not IsNull(Me.Filte rClientName) Then
strWhere = strWhere & "(ClientNam e Like ""*" &
Me.FilterClient Name & "*"") AND "
End If

If Not IsNull(Me.Filte rMatterName) Then
strWhere = strWhere & "(MatterNam e Like ""*" &
Me.FilterMatter Name & "*"") AND "
End If

If Not IsNull(Me.Filte rMatterStatus) Then
strWhere = strWhere & "(MatterSta tus Like ""*" &
Me.FilterMatter Status & "*"") AND "
End If

If Not IsNull(Me.Filte rMatterSpecialt y) Then
strWhere = strWhere & "(MatterSpecial ty Like ""*" &
Me.FilterMatter Specialty & "*"") AND "
End If

If Not IsNull(Me.Filte rMatterSpecialt yGroup) Then
strWhere = strWhere & "(MatterSpecial tyGroup Like ""*" &
Me.FilterMatter SpecialtyGroup & "*"") AND "
End If

If Not IsNull(Me.Filte rIndustry) Then
strWhere = strWhere & "(Industry Like ""*" & Me.FilterIndust ry
& "*"") AND "
End If

If Not IsNull(Me.Filte rJurisdiction) Then
strWhere = strWhere & "(Jurisdict ion Like ""*" &
Me.FilterJurisd iction & "*"") AND "
End If

If Not IsNull(Me.Filte rResponsibleAtt orney) Then
strWhere = strWhere & "(ResponsibleAt torney Like ""*" &
Me.FilterRespon sibleAttorney & "*"") AND "
End If

If Not IsNull(Me.Start OpenDate) Then
strWhere = strWhere & "([] >= " & Format(Me.Start OpenDate,
conJetDate) & ") AND "
End If
If Not IsNull(Me.EndOp enDate) Then 'Less than the next day.
strWhere = strWhere & "([] < " & Format(Me.EndOp enDate + 1,
conJetDate) & ") AND "
End If
If Not IsNull(Me.Start CloseDate) Then
strWhere = strWhere & "([] >= " & Format(Me.Start CloseDate,
conJetDate) & ") AND "
End If
If Not IsNull(Me.EndCl oseDate) Then 'Less than the next day.
strWhere = strWhere & "([] < " & Format(Me.EndCl oseDate + 1,
conJetDate) & ") AND "
End If
'************** *************** *************** *************** ************
'************** *************** *************** *************** ************

lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else strWhere = Left$(strWhere, lngLen)

Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub

Oct 18 '06 #1
0 1025

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

Similar topics

121
10025
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
19
4091
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
3
1974
by: dskillingstad | last post by:
I'd appreciate any help I can get. I'm not sure what I'm doing wrong, but.... I've searched these groups for some solutions but no luck. I have an unbound form (frmSearch), with several unbound text boxes on it and a command button bound to a macro which fires off a parameter query based on the criteria/string that the user types into the text boxes on frmSearch. My goal is to create a search form where the user can search by any of...
2
3201
by: kev | last post by:
Hi Folks, I have created a search query in which it successfully returns correct results. When there are no records returned, instead of giving out a blank form i created a pop-up msg which is attached to the On Open event. However, right after the msg box pops saying"no records", this is followed by another msg box with "TheOpen Form action was cancelled". Is there a way i can eliminate the second msg box from appearing?
9
2808
by: AMBLY | last post by:
Hello ! Hope someone might be able to help me with this one. I run Access2000 on XP. I have a form : frmONE- which contains a txt field: ctrCTN from my table/database. The values in ctrCTN are unique. Next to this field is a cmdFIND button frmONE is open and the active window. I want to search for values in ctrCTN, and go to the record which contains that value. I do not want to use a cmdButton with in-built Access Find procedure to...
1
1452
by: cherrieccs | last post by:
Hi everyone, I had made a search form in ACCESS with some coding from internet. However, i noted that if some field is blank, it will not able to search any result even if it is found in the database. Would anyone help? Form layout is under the following link http://www.geocities.com/richie_ccs/form.bmp Coding from internet (Allen Browne) If Not IsNull(Me.Worktype) Then
21
34385
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
4
1559
by: Twisted01 | last post by:
Hello, I am new here and I hope I have the correct forum to answer my question. I am creating a website for a friend and they need a "Search Form" so that visitors can search for items on the website rather than searching the entire website to find what they are looking for. I know about my HTML/XHTML and CSS coding and the basic coding for a Search Form. What I need is help with any other files needed to make my Form a workable Search Form so...
2
3033
by: hollinshead | last post by:
hi there, i have been having this issue for quite some time now and i cant seem to get my head around it. I am trying to create a database for candidates CV's and covering letters. basically the data that is stored is made up of qualifications and areas of business that candidate is involved etc. My problem is with the query by form where i have a range of combo boxes and list boxes. The combo boxes are working fine, no problem however the...
0
8403
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
8833
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
8737
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
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...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4168
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...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
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.