Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Problem

Status
Not open for further replies.

MY3MCS

Technical User
Apr 17, 2003
49
GB
Can anybody help me with this please?

I have a grid and a button named loadbtn. When I click this button, I want to see only those records from my database whose transaction date (field name is TRANDATE) is 05/15/2003. Can you tell the step by step procedure please? To tell you honestly I'm not that good in Visual Basic programming.


Thanks.
 
You might start with something like this in your command button click procedure:
Code:
    Dim MyRS As ADODB.Recordset
    Dim MySQLString As String
    
    Set MyRS = New ADODB.Recordset
    MyRS.CursorLocation = adUseClient
    MySQLString = "SELECT * FROM myTable WHERE Trandate = '05/15/2003'"
    MyRS.Open MySQLString, MyConnection, adOpenDynamic, adLockOptimistic
    
    Set MyGridControl.DataSource = MyRS
 
A simple method would be to use an ADO data control and bind it to the grid. There is good information in the help files, this forum, forum709 and msdn. Take a look and get back to us when you are stuck.

Thanks and Good Luck!

zemp
 
Thanks but how can i get in to forum709? Is it in FAQs? Under what title? Thanks again.
 
To get into the forum just click on the link I and you provided. Then use the keyword search for 'ADO data control' or 'ADODC' or 'ADODC1'.

Thanks and Good Luck!

zemp
 
Don't forget to search this forum as well.

Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top