0 Replies - 871 Views - Last Post: 12 December 2013 - 05:48 PM Rate Topic: -----

#1 143Dongwoon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 08-December 13

Filter vb 6

Posted 12 December 2013 - 05:48 PM

Filter vb 6
how to filter record using dataenvironment?. I want to get the ID, Lastname, Givenname, YearSec & Course in the database. can someone help me? Seems my code is wrong.

here is my code on Dataenvironment.
Searchpatients(connection) 
(command7)
SELECT * FROM patients where ID like '%" &  Lastname '%" & Givenname & "%' & YearSec '%" & Course '%"

and here on Form text2.text
Adodc1.RecordSource = "select * from patients where ID & Lastname & Givenname & Lastname & YearSec & Course like '" & Text2 & "'"
DataEnvironment1.Searchpatients (----It gaves me error in this line "INVALID USE OF PROPERTY")

DataEnvironment1.rsSearchpatients.Filter = "ID '%" & Givenname '%" & Lastname '%" & YearSec '%" & Course & "%'"


With DataEnvironment1.rsSearchpatients

If DataEnvironment1.rsSearchpatients.EOF Then
MsgBox "Not Found"


Else
MsgBox "Found"
Adodc1.RecordSource = "select * from patients where ID & Lastname & Givenname & Lastname & YearSec & Course like '" & Text2 & "'"
Adodc1.Refresh
 


Is This A Good Question/Topic? 0
  • +

Page 1 of 1