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

Form Search Engine - Please help

17
I am working on a form in my application for a Worker Profile evrything is working fine except the Search Box. I have to be able to search on two criteria. One is the WorkStatus i.e. Active, Inactive,etc. and 1 of three other choices. First Name, Last Name or SSN. I have pIaced 4 unbound text boxes on my form tied to the select query that pulls all the records called Work Add/Edit Query. I can run with the status and it works fine but how do I include one of my other criteria with that? As soon as I add another criteria to my query it doesn't work. I am stumped. Doug
Nov 23 '08 #1
4 1248
Dököll
2,364 Expert 2GB
@Dbar10
You might find it more helpful doing every thing query based in Access, and keep very little coding in your VB app...

See if this can help guide you:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Set my_database = OpenDatabase("C:\DataGram\Data_Central.mdb")   
  3.  
  4. 'this function will open your database in access (provided that it is closed access)
  5.  
  6. Set my_record = my_database.OpenRecordset("SELECT * FROM LIBRARY WHERE Your_Price LIKE '" & Text1(0).Text & "' OR Name LIKE'" & Text1(1).Text & "'")    
  7.  
  8. ' above is used to search by price and/ or name, only if data already exist   
  9. 'you can also add AND there to fit your needs...
  10.  
  11. Do While Not my_record.EOF  'this function will keep searching for fields matching each textbox
  12.         Text1(0).Text = my_record.fields("Your_Price")
  13.         Text1(1).Text = my_record.fields("Name")
  14.         Text1(2).Text = my_record.fields("Type")
  15.         Text1(3).Text = my_record.fields("Crime_Rate_1")
  16.         Text1(4).Text = my_record.fields("Crime_Rate_2")
  17.  
  18.  
Post your code if this isn't it, but above runs here looking for price for appartments and name depending on similarity.

Hope this helps!
Nov 24 '08 #2
Dbar10
17
Thank you. I only have this in a query in Access. I don't know where to put this code. Is it in each of the unbound boxes? Sorry, I am not well versed in VB. I can do simple things, but can this be done in a select query?
Nov 24 '08 #3
debasisdas
8,127 Expert 4TB
why not filter the data based on criteria in the SQL query itself using LIKE .
Nov 24 '08 #4
Dbar10
17
What was I thinking? Thank you. That worked great.
Nov 25 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: R. Rajesh Jeba Anbiah | last post by:
Q: Is PHP search engine friendly? Q: Will search engine spiders crawl my PHP pages? A: Spiders should crawl anything provided they're accessible. Since, nowadays most of the websites are been...
5
by: David | last post by:
Hi, I'm trying to add a search facility to a page that looks for matches in one, other or both memo fields of a database. The code below works fine if the visitor types in one word, or the term...
11
by: Petre Huile | last post by:
I have designed a site for a client, but they have hired an internet marketing person to incrase their search engine ranking and traffic. He wants to put extra-large fonts on every page which will...
5
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine...
2
by: vichet | last post by:
Hi All; Please help me with some problem i want VBSCRIPT to search something in only my own website give me code thank vichet
5
by: Sam | last post by:
Does anyone know of a way to create a search page under ASP.NET 2.0? I have started out by configuring a catalog in Index Server, registering the aspx, ascx extensions in the registry to allow...
4
by: zakhirn | last post by:
Hello, I have an extremely new user to XML and XSL, and I would like to know how to search XML data via a input form in HTML, and have the results displayed in HTML. If anyone has code that...
2
by: MNNovice | last post by:
I am working on a database on my CD collection using Access 2003. Some of the table structures are given below. Table 1 tblMusicCategory Field 1: MusicCategoryID - Auto Number (PK) Field 2:...
3
by: jerry101 | last post by:
Okay, so I have no knowledge with ASP and I was asked to look at this contact form because the emails aren't delivering. I'll post the whole page of code, because I am unsure at what is what...
9
by: weirdguy | last post by:
Hello, Just for anyone information, there is a similar title "Search in Listbox" but it is via Combo Box. In case, anyone need it, I put a link to here. Please let me know if I break any rules...
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: 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: 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...
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...
0
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
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,...

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.