Searching For A Name In A Lsitbox
how would you search for a name in a list box. like if i had a listbox that had these things in it:
blah blahblah blahhh
how would i search and find a certain one according to names not index.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Lsitbox
hi,
how can I select a item from my listbox and made some event occur?
Thanks in advance.
wang
Delete Items From A LsitBox
I'm trying to delete items in a listbox that the user has selected. Currently my code deletes half of the items selected. (If 10 items were selected 5 would be deleted from the listbox, and the other 5 will remain). Any suggestions? Thanks
VB Code:
'*CMDVERIFY_CLICK()************************************************************'NAME: cmdVerify_Click()'DESC: Allows the user to verify that they have counted the selected item(s).Private Sub cmdVerify_Click() Set connection = New ADODB.connection connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source= G:FinanceInventory ControlCycleCountDBcycleCount.mdb" connection.Open Dim counter As Integer Do While counter < lstVerificationScreen.ListCount If (lstVerificationScreen.Selected(counter) = True) Then Dim selectStatement, sSQL As String Dim strArray() As String strArray = Split(lstVerificationScreen.List(counter), vbTab, -1, 1) selectStatement = "DELETE FROM [MAIN] WHERE ID=" & strArray(0) sSQL = "UPDATE [ALTER] SET TYPEOFCHANGE='DELETED' WHERE [MAIN ID]='" & strArray(0) & "'" connection.Execute sSQL connection.Execute selectStatement lstVerificationScreen.RemoveItem (counter) End If DoEvents counter = counter + 1 Loop connection.Close Set connection = Nothing End Sub'*ENDOF*CMDVERIFY_CLICK()******************************************************
Using Checkbox In Lsitbox To Save Settings ??
HI,
i'm making a program that wil change registry settings for a user. I want to build in a listbox in checkbox state and the user must be able to click on the item(There by checking it) en then when the press save and the registry settings will be saved. The problem is i dont how how to get selected box's and pass the value's.
Example.: If a user selected NoFind in the list box i must change the dword HKEY_blabanotherkey..NoFind in to 1
normaly i would do this like X=savesettings HKEY_blabanotherkey..check1.value (i when use checkboxes)
But how do i do this with a listbox ??
Thanx in advance for the help
Searching For A Directory Vs Searching A Text File For The Same Thing!
After working on a piece of code for a while, and actually getting it to work, I was asked to do it a different way.
Originally, I had a login box set up to search for a user's username and password that was stored in a text file. The problem with this was that I didn't know how to get it to search ALL of the entries, not just a set 1 to 10 like I was using in my code. To see the full program code, click here.
Now my group members want me to do it so that it searches for the directory instead of the text file for the same information. The directory name is the username, and in the directory, they'd like (theoretically speaking) to have the user's username and pass stored in a pwd file or a txt file.
I'm trying to argue that searching a text file's easier (partly because I believe it is, and also because I've already done it), but they're arguing that searching the directory's easier because then, the program could just store the directory in a global module, so when it comes to other aspects of the program itself, it'd be easier to do.
I'm willing to give the 'searching for the directory' route a try, but I can't seem to find anything that pertains to this, WITHOUT using api (I've searched the forum, and all I found was recursive search for stuff thats already in a directory, or stuff that has to do with api).
Any help would be greatly appreciated.
Searching .dat
hey
How can i search a .dat file for a string of text?
Thanks
Billy
Searching
Can you tell me please how to seach a .dat file for a string of text in vb?
Searching....
can u give me some advice on how to search all the records in a table and validate them when i enter one of the records in a text box?
Thanks
Searching
Hey
I have a DBGrid linked to an access table. I have some command buttons that search through the table, however if you search with one command button then search with another, the previous search will be lost. The command buttons are linked to queries in access.
For example
I have one command button called "Forest Gate". When the user clicks this all the fields with Forest Gate will be shown in the DBGrid. Then if the user clicks on a command button called "Flat" then all of the Flat's will be shown. What I want to do is for the first search to remain but for it to show all of the Flats in forest gate. Hope that makes sense.
Here is the code that links the command button to the query
Code:
Private Sub cmdforestgate_Click()
Data1.RecordSource = "Forest Gate"
Data1.Refresh
End Sub
Hope that makes sense
Thanks for any help
G
Searching Here
If I wanted to search this site for all posts that contain two or more keywords and I only want the results that have all the keywords, what is the keyword syntax. I have tried things like smtp+tutorial, smtp tutorial or the boolean smpt AND tutorial and the results I get are posts that either contain smtp OR tutorial or both. I would like ONLY the post that contain both.
Thanks,
Joe
Searching
Would like to know how to search a Access table for certain information. The information that I need is this: Number of hours worked and the estimated pay due, based on dates. How do I do this? I have looked at posts and FAQ's and tutorials, and I cant figure it out.
Thanks for the help in advance.
Jon
Searching
Ok first off, sorry I did a search and can see the question has been asked many times. It seems what I want to do is called a recursive search. It could be I was up all night but so far I dont get thi yet. What I want to do is make a pogram to search the whole HDD for the file I want. Kind of like the search built into windows just a lot less features. So can any one tell me how I would make a program to search for say title.wma? Again Sorry I am reasking this old question.
Searching...
Hi
I was wondering if there was a way to search a directory or path for a file?
(Similar to START, SEARCH, For Files and Folders - but maybe just the files...)
Thank you Kindly
aplevel101
Searching
I just posted, but another question popped up
I have a textfile. The data is stored as such:
Last name, first name, Identification #, Date of Birth
Now suppose I wanted to search for a particular person. I know his first name, and his date of birth.
Obviously searching for his first name alone would yield many results. But searching for his date of birth, as well, would narrow the field.
What is the most effective way to conduct this type of search? (assuming that the user could input last name and first name, or last name and DOB, or last name, first name, and DOB and so on and so forth.).
If there is I result, then I would like to display more information on that individual.
If there are more than 1 result, then I would like to display the results.
If there are 0 results, then a message box appears, warning the user that the search was unsuccessful.
Thanks
Searching Help...
I want to be able to search a rather large word list (directly from a file as it's too big to load in a list box) for a certain string..... for this example I will say, any word in the list which contains 2 (or more) consecutive underscores "__".... Then I want the prog to take the words it finds that meet this criteria, and write them to another text file...
So basically, I should end up with a seperate list of nothing but words that contain 2 or more consecutive underscores somewhere in them.
I have other criteria that I need to use to filter this large list out, but once I see how this one's done, I think I can figure the rest out...
thanks in advance...
Ody
Searching...
I have a bunch of data in a file... and I want to search for a particular data... so, I've decided to load everything from a file into memory...
I have 2 choices, Array and Collection
But which is better to perform a search? I mean in terms of speed.
I use the KEY in a collection to locate a data. Could it be faster than a for loop for Array?
Any other suggestion? Thanks.
Searching
Is there a way to search a folder for a certain file?
Searching
I am attempting to create an application that contains two drop down menus. The first displays a list of possible files depending on what option buttons is selected, and the second just has 3 standard options (they relate to computers). How would i go about getting the application to search the selected computer/s to find the file that was selected in the first drop down list, and to then take information about that file (eg, its version number and its location), and write it to an output file? I sorta know how to do the writing output, but whenever ive got it to work, it only writes to one or two lines, then the next time it overwrites the previous information.
thanks for any pointers/help
Searching
I'm trying to enable a form to search the contents of my database, I can not get it to work, I've got the following code.
Private Sub cmdFind_Click()
'Dim src As String
'save current pos
Bookmark = datref.bookmark
'determine seacrh criteria
src = InputBox$("Enter name to find")
'exit procedure if nothing typed
If src = "" Then
Exit Sub
End If
'enable wild card
criteria = "Name like '" & src & "*'"
'try to find record
datRef.Find criteria, , , 1
'if no match
If datRef.EOF Then
MsgBox "No record Found!", , "No Match"
End If
End Sub
Its not liking anything with this, I've tried quite a few changes but can't get anywhere, any help?
Thanks
Neil
Tried Searching, Please Help!
Alright here goes-I didn't know exactly what to search for so please bear with me.
I'm totally new to VB but need to write a script that will, based on computer naming convention, map the correct printer. I need to do this so my users can log onto computers in various labs and the script will automatically map the printer in the that lab. Here's the code that I have come up with:
Option Explicit
Dim oNetwork, sPrintPath
set oNetwork = CreateObject ("WScript.Network")
' Begin Callout A
Select Case oNetwork.ComputerName
Case "TESTSTATION2"
sPrintPath = "\ISD316MAINGHS_LABAHPDJ500"
Case "TESTSTATION1"
sPrintPath = "\ISD316MAINGHS_LABBHPDJ500"
'Case Else
'sPrintPath = "\ISD316MAINNOWORKIE"
End Select
' End Callout A
oNetwork.AddWindowsPrinterConnection sPrintPath
ONetwork.SetDefaultPrinter sPrintPath
My question is....
Where the Case statements begin, the computers will be named GHSLABA1, GHSLABA2 and so on...there are 30 computers in Lab A and we have multiple labs so I want the script to search for the first part of the computer name (GHSLABA) and ignore the number. This script does function correctly but only if I make a seperate case statement for each computer in each lab.
I hope I am making sense, please don't rant hehe I'm a total beginner with this but have gotten pretty far on my own.
Thanks in advance,
Josh
Searching
hi, i'm new to visual basic.
i'm currently creating a program which allows users to view their horoscopes. In order to view their horoscope, the user must input either their date of birth (dd/mm) or their zodiac, then searches...and i have no idea where and how to start.
could someone help me please!!
Searching DB
I have a form with two combo boxes, cboBuilding and cboApartment, and an adodc adoVacants. The idea is to select one of the listings in the cboBuilding combo box and when you click on the cboApartment combo box (or anywhere since the code is in a lostFocus sub of the cboBuilding) then it suppost to search the recordset of adoVacants and populate the cboApartment combo box with vacant apartments. But I can't get it to work! Need some help!!!
Here is my code...
Private Sub cboBuilding_LostFocus()
Dim strBuilding As String
strBuilding = Cstr(Me.cboBuilding.Text)
If Me.AdoVacantApt.Recordset.RecordCount > 0 Then
Me.AdoVacantApt.Recordset.MoveFirst
End If
Do Until Me.AdoVacantApt.Recordset.EOF
If Me.AdoVacantApt.Recordset.Fields("Building") = strBuilding And Me.AdoVacantApt.Recordset.Fields("Vacant") = "Vacant" Then
Me.cboVacants.AddItem Me.AdoVacantApt.Recordset.Fields("Apt_Number")
End If
If Me.AdoVacantApt.Recordset.RecordCount > 0 Then
Me.AdoVacantApt.Recordset.MoveNext
End If
Loop
End Sub
TIA
Searching
Hi,
I am relatively new to Access and the ADODC in VB!!!!
I am sure it is quite simple, but i was wondering if anyone could tell me how to search a database using VB!!! I have created a program attached to the database, it can do all the basic functions such as add, update delete etc... but i need to be able to search it for specific records, how can i do this and display the results with VB??
Thanks
----------------------------------------------------------------------------------
Need Help Searching Db
I am trying to search an Access db and display results in a Grid,
The user enters criteria into a text box e.g "Large Bag". A memo type field (ProductDescription) is searched for any data matching this criteria.
The db has entries such as "Large Brown Bag Size 12" , "Large Leather Bag" etc. I want to show all matching results (like a search engine) then the user can click on the grid and a form will pop up showing full details of this entry. This part have done. But having problems with the search function. I have tried using GetRows Instr() Split() with the search criteria , but I lost the plot. Any pointers in the right direction will be appreciated. Thanks
Searching A DB VB5
Struck a bit of a problem whilst creating a database,
i have to search through the db for a string, (set by user) in a field of the DB, (not set by user, (at this time)) but the best i can do is to get an error 3015 :<Index name> isn't an index in this table. Look in the Indexes collection of the TableDef object to determine the valid index names.
Firstly, what is the Tabledef object, i don't know what it is,
secondly, how can i find a list of the indexes on the tabledef?
Would the index list be the same as the textbox datafield, after i link the txtbox to the databox scrolly thing?
I don't have much of a clue, but i have a VB Prog book on VB 6 (I use VB5, couldn't find book on VB5), and it gives the following code, which works? BUT only in the prog it comes from, i don't understand it at all!
Private Sub cmdFind_Click()
prompt$ = "Enter the full (complete) course title."
'get string to be used in the ClassName field search
SearchStr$ = InputBox(prompt$, "Course Search")
datStudent.Recordset.Index = "ClassName" 'use ClassName
datStudent.Recordset.Seek "=", SearchStr$ 'and search
If datStudent.Recordset.NoMatch Then 'if no match
datStudent.Recordset.MoveFirst 'go to first record
End If
End Sub
PLEASE PLEASE HELP!!!!
Toby
p.s. if you want to know anything else that i didn't know you need to know, just post and ask!
Go and See My Website, please?? www.madtaj.com
HELP: Searching Using DAO
hi, im new and i need a favor for anyone to do me a code for searching records using DAO.
i have a form with a textbox (text1) , a command button (cmdSearch) and a listbox (list1). i want to search through my database by typing the "name of the company" on the textbox and by pressing the search button, results will be displayed on the listbox..
the name of the data is "data1" and the field name to be search is "Company Name". thnx a lot!
Searching Through DB
hey.
is it possible for me to display matching names in a text box, that are in the database. like if i have a "John Smith" in the database and i press "J" in the text box, it displays "John Smith".
thanks for the help...
DK
Searching Through A DB In VB6
Hi, I have a DB with the following fields:
songID
artist
songtitle
year
lyrics
I would like the user to be able to enter some text in a txt box for songtitle, click the Search button, and it finds all records with the words entered in the box, in the songtitle. I've given it a go using an SQL statement:
Code:
Private Sub cmdSearch_Click()
Dim strSongname As String
Dim strSong As String
songname = txtSearch.Text
MyRecSet = MyConn.Execute("SELECT * FROM tblSong WHERE songtitle = " & strSongname)
strSong = MyRecSet("songtitle")
Do Until MyRecSet.EOF
lstSongs.AddItem strSong
MyRecSet.Movenext
Loop
End Sub
In case I hadn't mentioned it, I would like the songtitle results to be entered in the lstSongs ListBox.
Any help would be greatly appreciated.
Cheers!
Searching
hi, i'm new to visual basic.
i'm current creating a program which allows users to view their horoscopes. the user would have to input their zodiac OR date they were born, in order to search.
what i'm having trouble with, is the searching bit. i have no idea on where and how to start. could someone please help!!
Searching
Ah, getting back into my program again...
How do you do searches in a database?
Isn't there a .Filter command.
Its suppose to (for now) have one form with text boxes, it searches by those, and the range or results are listed in text boxes on another form.
I just done a simple one, with one text box, but it gave me an Invalid use of Property error.
Searching
How is it possible to search for specific words in a MsAccess database attribute using SQL? The idea is to allow users to enter keywords or a sentence/phrase used to search a memo data-type attribute containing an article. Basically its something like the search system implemented on this site but will be used in my content manager. PS. is this impossible using purely SQL unless i have an SQL database with full-text support?
Searching For Something That Isn't There
I need the program to search the table and find the first unused ID number and then save the information from the form using that ID number.
The search needs to loop through the recordset and check the <LastName> field to see if it is empty. If it is empty stop the search and display the ID number in txtIDNumber textbox and clear the rest of the form for new information. In this table it would stop at ID 2 and clear the form.
I am using VB6 with Access 2000 and SQL.
I can get the VB program to loop through the records using For..Next/Do..While loops but can't get it to search the <LastName> fields.
Table to be searched looks like this when db is opened in Access.
ID|LastName | FathersName | MothersName
1 Martin Ron LuAnn
2
3
4
5
6
7
8 Sensenig Lamarr Naomi
9
10
11 Snavely Mike Mary
12
Searching....
i have a database with about 8 different fields, I want to create a form that has textboxes that match up with the fields, after doing this I need to be able to search and display data based what is filled in the textboxs...
Here is where I need help, I might be searching only 2 or 3 of the fields at a time, but I want to be able to search however I might want. How can i go about doing this?
Hope it makes sense....
Searching
Hi,
I’m doing a search program. It works file as I’m using a API search. The search will search for a file type E.g. *.exe but if you want to search for *.exe and *.zip then you will have to search twice. Now I will be searching for 3-4 file types on a server and to do it 3-4 times to get all the file types I want will take too long. I was after a newer search API or a way for the search API I have to search for multiple file types.
I’m using this one.
Code:
'KPD-Team 1999
'URL: [url]http://www.allapi.net[/url]
'E-Mail: [email]KPDTeam@Allapi.com[/email]
'How to use this form:
'Here's a sample that shows you how to search all the text-file from the C:
'Dim Col As Collection
'Set Col = frmSearchFile.SearchMultipleFiles("C:", "*.txt")
'This piece of code shows you how to get the list of the retrieved functions
'Dim Cnt As Long
'For Cnt = 1 To Col.Count
'List1.AddItem Col.Item(Cnt)
'Next Cnt
'Here's the code if we want to search a file, named 'test.txt' on the C:
'Dim Ret As String
'Ret = frmSearchFile.SearchFile("C:", "test.txt")
Any Ideas how to get it to find multiple file types, or a newer search API?
Thanks.
Searching
Can someone please shed some light on this simple process please.
Sometime ago I had a form made where I entered the search in a frame at the top then it loaded the info to the frame below.
I would like to make some simple search form using this website"
Code:
http://www.liutilities.com/products/wintaskspro/processlibrary
Anything that is placed after the /processlibrary/ e.g. /processlibrary/abc.exe
The website looks up abc.exe and displays the results.
I wanted to know if it was possible to port the same using a vb app, could this be achieved?
Thank you.
Searching
I am creating an application which searches google with a given search term, then goes to all the pages and finds the email addresses for the search term. Now the spider itself isnt that hard but getting it to go to the resulting sites and search each one is difficult. I was just wondering if anyone has done this before or can give me pointers. BTW this is not going to be used for spam at all.
Chm Help Searching
I want to add menu options under Help.
Contents, Index, & Search
I have Contents and Index working right. I can not get Search to work at all.
VB Code:
Const HH_DISPLAY_TOC = &H1Const HH_DISPLAY_INDEX = &H2Const HH_DISPLAY_SEARCH = &H3Const HH_DISPLAY_TOPIC = &H0Const HH_SET_WIN_TYPE = &H4Const HH_GET_WIN_TYPE = &H5Const HH_GET_WIN_HANDLE = &H6Const HH_DISPLAY_TEXT_POPUP = &HEConst HH_HELP_CONTEXT = &HFConst HH_TP_HELP_CONTEXTMENU = &H10Const HH_TP_HELP_WM_HELP = &H11Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _ (ByVal hwndCaller As Long, ByVal pszFile As String, _ ByVal uCommand As Long, ByVal dwData As Long) As Long
In my subs for the menu I have
for Contents
HtmlHelp hwnd, App.HelpFile, HH_DISPLAY_TOC, 0
for index
HtmlHelp hwnd, App.HelpFile, HH_DISPLAY_INDEX, 0
for search
HtmlHelp hwnd, App.HelpFile, HH_DISPLAY_SEARCH, 0
The first two work fine just search does not work. Nothing happens at all.
Searching
Hi guys, i have already made a diffrent thread on searching, but this is completely diffrent.
This time i want to learn how to do a search in a listbox, so if i have 100+ entrys with names in them (from a-z). I dont want to scroll down to spike, i want to type it in the search text box, and it will bring up the resualt spike. at the same time i would like it to look for entrys that are similar to waht has been typed. eg. I type in spike and there is "spike", "spiker" and "spikester" in the list. it must bring up all of them.
But all i need at the moment is the search code.
Thank you very much
Searching A DB From VB App
hello all
I have just started using MS Access and have kindof got the jist of how to use it but now I need to hook it to my vb app. I will be using the vb app as the front end and Access as the back end
I have a vb form that I have hooked a Table named Customers though drag and drop(I think made the table data bound) from a DataEnvironment named Connection1 with command1 as the command name DBobject is table and Object name is Customer
and I have created a Query named Query1 with fields named First Name, Last Name and Address so that the user can try to find a customer via the customers first or last name or by there address.
that all works in Access but now I want to make a textbox that would query the customer table and then the queried customer would be display in the vb table.
When I try to drag and drop the query onto a blank form I get this error
"Fields not found"
some guidence sure would be apperciated
Searching
Is there a way to search for a file with CMD/DOS it cant be a vb6 command though it needs to be a CMD/DOS comamnd. Such as the linux command whereis .
Searching
Please someone help.
I have a .Dat file that contains a list of Parts and part numbers. I need to write a small program that searches the .dat file and displays the lines that include the searched Item.
I.e The user enters the part descripition
Pulley
the program then searches the file and displays all lines with the word pulley.
the format of the lines in the file are as follows
"Giggle Pin 123C"
"foo foo Valve 124C"
I am aware this maybe a very simple program that I really should know how to do. But i am fairly new to VB6 and I am getting abit frustrated Please help.
Thank You
Searching
Stumped...here is my code
VB Code:
Private Sub Form_Load() Open "F:StephProgramExcel_IP_AddressUsers.txt" For Input As #1 'open file to read dataOpen "F:StephProgramExcel_IP_AddressIPAddress.txt" For Output As #2 'create file to write outputOpen "F:StephProgramExcel_IP_Address
oMatch.txt" For Output As #3 On EOF(1) GoTo 35 Line Input #1, x$ 'clear headerOn Err GoTo 35 'if error occurs close 'Client1$ = client'Serial$ = serial number'User$ = user'IP$ = IP Address'Client2$ = client'Add$ = Address Write #2, "Client", "Serial NUM", "User", "IP Address", "Client", "Address" 'write header in file #2 outputWrite #3, "Client", "Serial NUM", "User", "IP Address", "Client", "Address" Do Until EOF(1) ' if not end of file loop through records Input #1, client1$, Serial$, User$, IP, client2$, Address$ 'input strings into file #1 If client1$ = client2$ Then'if client1$ equals client2$ then write to file and copy $Add to IP$Write #2, client1$, Serial$, User$, Address$, client2$, Address$ 'else if Client1$ != client2$ then loop through recordsElseIf client1$ <> client2$ Then 'If client2$ = any client2$ write #2 'else write to file #3 not used noMatch Write #3, client1$, Serial$, User$, IP, client2$, Address$ End If GoTo 3030 Loop 'loop for do until EOF35 Close #1 'close file if error200 Close: End 'close file and END End Sub 'End Program
and now my question,
VB Code:
'else if Client1$ != client2$ then loop through recordsElseIf client1$ <> client2$ Then 'If client2$ = any client2$ write #2 'else write to file #3 not used noMatch
can anyone get me started on this
i need to search through a column and find a match
if client1 doesnt = client2
then
look at client2 and search entire column to for a match
if client2 = any client2 then print that record to file
else
end
thanks in advance
annie
Searching A DAO
could someone please tell me how i can search a DAO from a user text input. this is really pissing me off now and i need to know!
Tag Searching
Basically ive got a file thats set up in tags (similar to the html format), but i dont know how to load it. Right now I load the lines of the file one by one, and run a loop to figure out what the tag is. Is there a better way?
Searching!!!
here is the picture of the game i am working on.
click the link below to see the picture
Grass, road, user are in the image box.
I want the user to walk only on the road, not on the grass.
how do i do it??
Searching
Ok, I have designed a Catalogging program for my dad, however the one missing thing is the ability to search. I have stored the different catagories in different files (Genre - Genre.txt; Fiction - Fiction.txt; Non-Fiction - Non.txt) and are each displayed in a seperate list box. All very primitive I know, but it's a start. But now I want him to be able to search for a title, then the search will come up with the book name after searching through the txt files. Is this possible and if so, how? or if it's not possible how else would I do it.
Please help, It's quite urgent.
Searching
I am making a software to prepare question Paper in VB6.0. Suppose there is a question “In the figure ~145~ similar to figure ~123~, Calculate T”
Here ~ denotes that there is a figure and the number after that is the imageid . This text is saved as it is in the database. Now when this question is to be shown I search for every ~ and when I find ~ I show the image corrosponding to image id and if I do not find ~ I show the text as it is. But the problem is that I scroll though all the characters in the question text. This takes a lot of time. Can Anyone help to reduce time
Regards
Varinder
Win Searching
Does anyone know where can I find a project with a source code
about how to search for a file in a hard drive?
thanx
Searching
Can anyone give me a demo project of a program that searches
the computer hard drive?
thanx
|