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

Double combined Search

Hi,

I have a form, on top of that form I made a cbobox with values called
cboSearch1, but also 2 checkboxes (chkSearch2 & chkSearch3).
Now I like to put some code behind a Command Button, so that a search in the
currect recordset i made on 2 of the 3 field (always cboSearch1 &
ChkSearch1 or ChkSearch2)

Thx in advance

TNG
Nov 12 '05 #1
1 1209
TNGgroup wrote:
Hi,

I have a form, on top of that form I made a cbobox with values called
cboSearch1, but also 2 checkboxes (chkSearch2 & chkSearch3).
Now I like to put some code behind a Command Button, so that a search in the
currect recordset i made on 2 of the 3 field (always cboSearch1 &
ChkSearch1 or ChkSearch2)

Thx in advance

TNG


Create a subroutine in the code. Maybe callit Findit(). You didn't say what
your were attempting to find. Here is something generic. It will not work,
it's just a blueprint on how you can do it.

Private Sub FindIt()
Dim rst As DAO.Recordset
Dim strFind As String 'holds the search filter
set rst = Me.Recordsetclone
strFind = "[YourFieldName] = '" & Me.cboSearch1 & "'" 'cbo value if text
field has single quotes
strFind = "[YourFieldName] = " & Me.cboSearch1 'cbo value if numeric
field has no quotes
If chkSearch2 then
strFind = strFind & " And [SecondField] = True"
else
strFind = strFind & " And [ThirdFieldField] = True"
endif

rst.findfirst strFind
If not rst.Nomatch then me.bookmark = rst.bookmark
set rst = Nothing
End Sub

Nov 12 '05 #2

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

Similar topics

11
by: Adrian Parker | last post by:
I have a database of 200+ tables (two tables per school), each with 100 - 4000 records (one record per student). A contract I'm looking at wants to be able to do a search across all the tables,...
10
by: Bulba! | last post by:
Hello everyone, I'm reading the rows from a CSV file. csv.DictReader puts those rows into dictionaries. The actual files contain old and new translations of software strings. The dictionary...
4
by: Ken Fine | last post by:
I'm looking to find or create an ASP script that will take a string, examine it for a search term, and if it finds the search term in the string, return the highlighted search term along with the...
6
by: Alan | last post by:
I'm just about to start a project that needs to combine the results of a SQL Server query with the results of an Index Server query. The basic idea is that the user enters/selects a bunch of search...
2
by: William Morris | last post by:
Apologies in advance for the cross-post. Not sure if this is better handled in ASP code or TransactSQL. Windows2000 Server SQL 2000 tblPeople contactid int firstname varchar(25) lastname...
4
by: Davy | last post by:
For example, I have a vector: double vector={1.11,2.38,4,53,17.14...,89.12,91.34} And if the Key I want is 5.2, the nearest item will be 4,53. I found that if the STEP of the vector is constant,...
8
by: Sek | last post by:
Folks, I have an ArrayList of integers. I have sorted the list already. Now, i want to find the index of the first element that is greater than a given number. How to accomplish this in C#?
3
by: JohnH | last post by:
I'm very interested in implementing double-metaphone search in my database to resolve customer names, and I've done quite a bit of searching trying to find a VBA implementation. I know that Clive...
2
by: woodey2002 | last post by:
Hi Guys and thanks for your time. I have a search form for my database that allows users to select multiple criteria from multi select list boxes. I successfully integrated a multi select...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.