|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Forms - Creating a Search Form
Hi,
I am currently working on a database for keeping a log of the 3000+ engineering drawings that are on record. I have them listed including by ID number including have a hyperlink to where they are located on the network and this is all well and good. However, each drawing has a description attached to it as well (it is one of the columns in the table including all the information) and i need to create a form that will search for a display a keyword that is present in the descriptions and bring it together in one list. I'm sure that this isn't too difficult but i am very new to this program and have been severly struggling to accomplish this. Any help would be greatly appreciated. Thanks, Moody |
|
#2
|
||||
|
||||
|
I suggest that you start out by either reading some online tutorials or perhaps viewing online video tutorials. If you enter the search terms ms access tutorial video in Google, you will find a wealth of such tutorials.
There are so many different ways to design a form to search for specific keywords that I wouldn't attempt to describe how in a post here.
__________________
Experience is the thing you have left when everything else is gone. |
|
#3
|
|||
|
|||
|
Yes, this should not be too difficult to do and as don94403 suggests, go through some tutorials to get a better handle on VBA coding and SQL query structures.
Also, am not quite clear on what you want to produce from such a search. You say 'display a keyword that is present in the descriptions and bring it together in one list' - you want to return the descriptions? One idea to try when you get 'learned up' is to enter keyword in a textbox and then with SQL SELECT query find records that meet the WHERE clause criteria which might be (for one possibility): "WHERE InStr([Description], '" & textbox & "') > 0". So build some code and post for analysis when you encounter problems. Last edited by June7 : November 2nd, 2009 at 05:52 PM. |
|
#4
|
|||
|
|||
|
well i did find a good tutorial video that walked through the creation of a basic search form and everything worked well, however this only searches for the beginning of the description.
A form was created that had an unbound text box with a command button. The code on the command button was as follows: Private Sub Command4_Click() DoCmd.OpenQuery "mainquery", acViewNormal End Sub Then the Query "mainquery" was created with the required fields. Uner the fields that are to be searched, in this case description, the code: Like [Forms]![Search].[search] & "*" was placed. Search being the name of the previous form and search being the name of the command button. How can i manipulate this so that it will not only search for items beginning with the criteria but anywhere in the description. |
|
#5
|
|||
|
|||
|
Use InStr function or place "*" before and after the search value.
|
|
#6
|
|||
|
|||
|
Quote:
ive tried placing the "*" everywhere and it does not seem to want to work, where would you usggest placing it? or how would the Instr function code look im sorry but i am awful with prgoramming |
|
#7
|
||||
|
||||
|
Instead of:
Code:
Like [Forms]![Search].[search] & "*" Code:
Like "*" & [Forms]![Search].[search] & "*" The * is Access' wildcard character; it means "anything". So if you place it both before and after the characters you are searching for, it will find all records that contain your search term, with anything before it and anything after it. The & is Access' concatenation character, meaning that it connects 2 strings together, one after the other. Keep reading tutorials and trying out techniques, you will soon overcome your issues with programming. |
|
#8
|
|||
|
|||
|
wow thanks so much,
over the past 2 days i have been going over tons of tutorials and the like and its been really helpful. The only thing that i was missing when i was attempting to do it was the second ampersand. Again, thanks alot |
|
#9
|
||||
|
||||
|
Glad you're making progress. The thing is, every language is different. In Javascript, the string concatenation operator is a plus sign! Just recently I was writing a little shell script in Linux and for the life of me, I couldn't remember how to concatenate 2 variables. Turns out, you just mash them together without a space. Who knew?!
|
|
#10
|
|||
|
|||
|
Which distrobution are you using Don?
|
|
#11
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Forms - Creating a Search Form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|