473,504 Members | 13,621 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.FilterClientName) Then
strWhere = strWhere & "(ClientName Like ""*" &
Me.FilterClientName & "*"") AND "
End If

If Not IsNull(Me.FilterMatterName) Then
strWhere = strWhere & "(MatterName Like ""*" &
Me.FilterMatterName & "*"") AND "
End If

If Not IsNull(Me.FilterMatterStatus) Then
strWhere = strWhere & "(MatterStatus Like ""*" &
Me.FilterMatterStatus & "*"") AND "
End If

If Not IsNull(Me.FilterMatterSpecialty) Then
strWhere = strWhere & "(MatterSpecialty Like ""*" &
Me.FilterMatterSpecialty & "*"") AND "
End If

If Not IsNull(Me.FilterMatterSpecialtyGroup) Then
strWhere = strWhere & "(MatterSpecialtyGroup Like ""*" &
Me.FilterMatterSpecialtyGroup & "*"") AND "
End If

If Not IsNull(Me.FilterIndustry) Then
strWhere = strWhere & "(Industry Like ""*" & Me.FilterIndustry
& "*"") AND "
End If

If Not IsNull(Me.FilterJurisdiction) Then
strWhere = strWhere & "(Jurisdiction Like ""*" &
Me.FilterJurisdiction & "*"") AND "
End If

If Not IsNull(Me.FilterResponsibleAttorney) Then
strWhere = strWhere & "(ResponsibleAttorney Like ""*" &
Me.FilterResponsibleAttorney & "*"") AND "
End If

If Not IsNull(Me.StartOpenDate) Then
strWhere = strWhere & "([] >= " & Format(Me.StartOpenDate,
conJetDate) & ") AND "
End If
If Not IsNull(Me.EndOpenDate) Then 'Less than the next day.
strWhere = strWhere & "([] < " & Format(Me.EndOpenDate + 1,
conJetDate) & ") AND "
End If
If Not IsNull(Me.StartCloseDate) Then
strWhere = strWhere & "([] >= " & Format(Me.StartCloseDate,
conJetDate) & ") AND "
End If
If Not IsNull(Me.EndCloseDate) Then 'Less than the next day.
strWhere = strWhere & "([] < " & Format(Me.EndCloseDate + 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 1018

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

Similar topics

121
9907
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...
19
4065
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...
3
1968
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...
2
3186
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...
9
2787
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...
1
1442
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...
21
34324
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...
4
1555
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...
2
3015
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...
0
7213
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
7098
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...
0
7298
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,...
1
7017
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...
0
7471
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...
0
5610
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,...
0
4698
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...
0
3187
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...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.