| | |
Alter Recordset by Text Box text.
![]() |
•
•
Join Date: Apr 2006
Posts: 7
Reputation:
Solved Threads: 0
I get the result I want in a Datagrid by using Recordset Sql:
Select * from MYQUERY Where (name Like 'WHATEVER*')
I change the name by retyping the whole line, substituting the new name,
typed into a long textBox named txt.Select, like this
Private Sub cmdSelect_Click()
Data1.RecordSource = txtSelect.Text
Data1.Refresh
End Sub
When try to use Select * From MYQuery Where ('name Like ' *')
and leave it in the TextBox, putting the next name in the space, nothing happens.
I want to put the names only in the textbox without retyping the whole line of sql to bring up the fields in my query.
Any offers of a few lines of helpful code would be much appreciated.
Bogeybrown
Select * from MYQUERY Where (name Like 'WHATEVER*')
I change the name by retyping the whole line, substituting the new name,
typed into a long textBox named txt.Select, like this
Private Sub cmdSelect_Click()
Data1.RecordSource = txtSelect.Text
Data1.Refresh
End Sub
When try to use Select * From MYQuery Where ('name Like ' *')
and leave it in the TextBox, putting the next name in the space, nothing happens.
I want to put the names only in the textbox without retyping the whole line of sql to bring up the fields in my query.
Any offers of a few lines of helpful code would be much appreciated.
Bogeybrown
•
•
Join Date: Apr 2006
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
Hi,
Just type the name in TextBox.
and alter the code like this :
Dim TStr as String
TStr = "Select * from MYQUERY Where name Like '*" _
& txtSelect.Text & "*'"
Data1.RecordSource = TStr
Data1.Refresh
Regards
Veena
Veena,
Many thanks.
With the addition of a pair of brackets, one before name and the second before the last pair of quote marks, it worked like a charm.
Yours,
Bogeybrown.
![]() |
Similar Threads
- pass the value to the text box (JavaScript / DHTML / AJAX)
- Text box question (C#)
- Text box population from DBgrid. HELP!! (Visual Basic 4 / 5 / 6)
- text is being written in text box (Web Browsers)
- Help with text box height (HTML and CSS)
- Cannot enter any text in a IE text-box (Viruses, Spyware and other Nasties)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: difficulty creating a formula with a macro
- Next Thread: how I can know the updates of dllfiles?
Views: 1999 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 access activex add ado append application array banned basic bmp box calculator click client code coffeehouse college column connectionproblemusingvb6usingoledb convert copy creative database designer desktop dissertations dissertationthesis edit error excel filter flex form game header ide image implements inboxinvb installation installer interaction keypress listview machine macro mail match memory number open os outlook password pause pdf picture pos prime print program programmer prompt query random range range-objects readfile record registration remotesqlserverdatabase report reports retrieve save search sites size spectateswamp sql string struct subroutine table textbox time timer variable vb vb6 vb6.0 vba vista visual visualbasic web window windows





