comcu Posted October 26, 2008 Posted October 26, 2008 Hi, Has anyone loaded a access data base into a data grid on a acad vba form? I have done this with vb6 before and tried to replicte the same with acad but the data grid seems to be missing the 'datasource' propertie? I have loaded the datagrid and adodc control and set the connection string and the control sourc but like i said the datagrid does not have a 'datasource' propertie? Cheers for any help, Col. Quote
borgunit Posted October 28, 2008 Posted October 28, 2008 I believe you would set that at runtime and not on the form. Here is an example I found.. strSQL = "SELECT NameLast, NameFirst, SomeMoney " & _ " FROM tblMyTable_0 M0, MyTable_3 M3 " & _ " WHERE M0.sysid = M3.sysid " & _ " ORDER BY NameLast " rs.Open strSQL) With dGrid Set .DataSource = rs .Visible = True .Top = TopPosition .Left = LeftPosition .Height = HeightValue .Width = WidthValue .AllowArrows = True .AllowRowSizing = True .ColumnHeaders = True For intRefCol = lBound(arrCol) To uBound(arrCol) With .Columns(intRefCol) .Button = True .Width = arrRefDisplayColWidth(intRefCol) .Caption = arrRefDisplayHeading(intRefCol) k = arrRefFieldSeq(intRefCol) Select Case arrRefFieldXref(k) Case "SomeMoney" .Alignment = dbgRight .NumberFormat = "$#,###.00" Case else .Alignment = dbgLeft End Select End With Next blnSortAsc = False .Refresh End With Quote
comcu Posted October 28, 2008 Author Posted October 28, 2008 Thank you for that, i will have a play around with the code. Cheers, Col Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.