Results 1 to 2 of 2

Thread: Help with DataGrid1

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Exclamation Help with DataGrid1

    VB Code:
    1. With frm0.Adodc1
    2. .RecordSource = "Select A.ColB, B.ColB from TableA as A INNER JOIN TableB as B ON (A.ColA=B.ColA) where A.ColC = 100 ORDER BY B.ColB
    3. End With
    4. frm1.Show
    5. Set frm1.DataGrid.DataSource = frm0.Adodc1
    6. frm1.DataGrid1.Columns(1).NumberFormat = "dd/mm/yyyy"
    7. frm0.Adodc1.Recordset.Requery
    8. rm0.Adodc1.Refresh

    1.Let's say that B.ColB is: date format, of the form mm/dd/yyyy, but when displayed on the Grid, I want it to be of the form dd/mm/yyyy. I try to do this by code, but it is not working...

    2.Let's say that B.ColB is the column chosen to be ordered by, but I want to view from the beginning (from the appearance of the Grid) the last 20 records. Meaning I want the scroll bar to be already scrolled to the bottom of the Grid and if I want to view older records I can scroll up.
    This is very weird because I already have this working with another DataGrid, on another form, but I can't seem to remember how I did it.....


    Can anyone please help with these 2 questions?thxxxxxx

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: Help with DataGrid1

    I have some typing errors on the code:
    VB Code:
    1. With frm0.Adodc1
    2. .RecordSource = "Select A.ColB, B.ColB from TableA as A INNER JOIN TableB as B ON (A.ColA=B.ColA) where A.ColC = 100 ORDER BY B.ColB"
    3. End With
    4. frm1.Show
    5. Set frm1.DataGrid.DataSource = frm0.Adodc1
    6. frm1.DataGrid1.Columns(1).NumberFormat = "dd/mm/yyyy"
    7. frm0.Adodc1.Recordset.Requery
    8. frm0.Adodc1.Refresh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width