This is a simple code.......
Dim rst as DAO.RecordSet
Dim my_sql As String
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordse t("SELECT * FROM data")
Me.display = rst(5)
The text box in the form can display the information I need. It is work.
However, I found a problem when I change the code to
Dim rst as DAO.RecordSet
Dim my_sql As String
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordse t("SELECT * FROM data WHERE Name LIKE 'A%'")
Me.display = rst(5)
There is nothing in the text box......
I am sure the Name column in the database have some data have 1st char 'A',
however nothing found.......
Is that any problem in my program??
I am using MS Access 2000 in my office
Reference:
Visual Basic For Application
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Active X Data Objects 2.1 Library
Dim rst as DAO.RecordSet
Dim my_sql As String
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordse t("SELECT * FROM data")
Me.display = rst(5)
The text box in the form can display the information I need. It is work.
However, I found a problem when I change the code to
Dim rst as DAO.RecordSet
Dim my_sql As String
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordse t("SELECT * FROM data WHERE Name LIKE 'A%'")
Me.display = rst(5)
There is nothing in the text box......
I am sure the Name column in the database have some data have 1st char 'A',
however nothing found.......
Is that any problem in my program??
I am using MS Access 2000 in my office
Reference:
Visual Basic For Application
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Active X Data Objects 2.1 Library
Comment