|
-
May 2nd, 2006, 09:26 AM
#1
Thread Starter
Lively Member
Help with DataGrid1
VB Code:
With frm0.Adodc1
.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
End With
frm1.Show
Set frm1.DataGrid.DataSource = frm0.Adodc1
frm1.DataGrid1.Columns(1).NumberFormat = "dd/mm/yyyy"
frm0.Adodc1.Recordset.Requery
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
-
May 2nd, 2006, 09:27 AM
#2
Thread Starter
Lively Member
Re: Help with DataGrid1
I have some typing errors on the code:
VB Code:
With frm0.Adodc1
.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"
End With
frm1.Show
Set frm1.DataGrid.DataSource = frm0.Adodc1
frm1.DataGrid1.Columns(1).NumberFormat = "dd/mm/yyyy"
frm0.Adodc1.Recordset.Requery
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|