Full Version: Creat e text Search
UtterAccess Forums > Microsoft® Access > Access Forms
vilmarie85
I need to create a text box that I enter any word and show me in a listbox all the record that the first letter is thge word that I enter in the text. I write the following code:
Private Sub cmdSearch_Enter()
Dim strFilter As String
Dim strSQL As String
If IsNull(Me.txtSearch) Or Me.txtSearch.Value = " " Then
sgBox " Please enter a Title", vbExclamation, "System Library Message"
Me.txtSearch.SetFocus
Else
If Not IsNull(Me!txtSearch) Then strFilter = strFilter & "[Title] Like " & Chr(34) & "*" & Me!txtSearch & "*" & Chr(34) & " AND "
If strFilter <> "" Then strFilter = Left$(strFilter, Len(strFilter) - 5)
Me!lstSearch.RowSource = strFilter
Me!lstSearch.Requery
End If
End Sub
But this not result. How I can resolved these? Thanks!!!
quest4
I have a couple of forms which you could use. I open them by clicking on a hyperlink, the nice part is that when you see what you want you can click on it and it then loads that record into the form. Someone hear gave it to me so if you are interested let me know. HTH.
vilmarie85
Yes I an interest in you help, please!!!!!
quest4
Here is a sample, but it has no table. It is set for partno and description currently. First go into the subform, in the data source, add your table and select what you want, it is a simple select query. Then in the part_number OnClick event make the appropreate changes. Then create a hyperlink to it and try it out. Remember if you change names, change the code. HTH.
vilmarie85
thanks!!!
quest4
Glad I could help. acclaim.gif
mkkashif
Can you give the example with table it is very easy to see.
thanks
quest4
My tables are ODBC linked tables, that is why I could not send them. Try to create a simple table with just two fields, partno and description. Call the table tblParts. Use that in the Subform's Data Source. I think you can guess the rest. Add a couple of test parts and you will see. HTH.
NoahP
See if the attachment helps.
oah
mkkashif
i creat a table and but it is not working
saying function not defined
you can see the attachment
mkkashif
thanks noahp
very usefull example.
quest4
Sorry I have to go to the doctor's now. Will work on it in the AM.
quest4
Sorry this took so long. To make up for it I added a few extra goodies. frmPartNoLookUp runs off the hyperlink in the form, frmParts. The other runs on its own. For the form double click it and hit return, which is no, enter 3. Have fun. When you are done exploring, click Close. Then double click frmPartNoQcaLookUp Have fun. Now see if you found all of the extras? I added two extras to the package. Good Luck. HTH. acclaim.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.