|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I have a small VB database, where I would like the user to have the option to filter the database records by a given letter or a group of letters (the data records are being viewed through a msflexgrid if that makes any difference and not through normal text boxes). I have tried several times to construct an SQL statement to include the "LIKE" option, but failed.
Can anybody help me please or point me in the right direction where I can get good examples of SQL statements using VB. Once again --- THANKS----- |
|
#2
|
|||
|
|||
|
select stuff from table where acolumn like '%" & avariable & "%'"
You can find sql help in Access help, sql server books online, the msdn library, and any number of websites.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Thanks Doug I will try it out........
|
|
#4
|
|||
|
|||
|
Hi Doug, I have tried your code, but it keeps coming up with a error. The code I have for my button is as follows: Can you tell me where I'm going wrong please. Thanks....
Private Sub cmdFilter_Click() Dim sql As String sql = "Select * from equipment where equipment_no like '% " & txtfind & " % " Data1.RecordSource = sql MSFlexGrid1.Refresh txtFind.text = MSFlexGrid1.text If txtFind = "" Then MsgBox "Equipment No Not Found" Dim all As String all = "Select * from equipment " Data1.RecordSource = all Data1.Refresh txtFind.text = "" txtFind.SetFocus Else MsgBox "Item Found" End If |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Filtering Data with SQL using a ADODC Data Source |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|