I try to change the column width with DataView1.View.Columns[1] = 50 but recieves error "Not a field" (translated from swedish). Code below:
Code: Select all
'Module1
Public $MyConn As New Connection
Public Procedure Connect()
$MyConn.Close()
$MyConn.Type = "mysql"
$MyConn.Host = "127.0.0.1"
$MyConn.Login = "Loginname"
$MyConn.Port = "3306"
$MyConn.Name = "Tablename"
$MyConn.Password = "pass"
$MyConn.Open()
End
'FMain
Public Sub Form_Open()
Dim Aheight As Integer
Dim Awidth As Integer
Module1.Connect() 'Establish connection to database
DataSource1.Connection = Module1.$MyConn
Aheight = Screens[0].AvailableHeight
Awidth = Screens[0].AvailableWidth
FMain.Width = Awidth
FMain.Height = Aheight
DataSource1.Height = (Aheight - 110)
DataView1.Height = (Aheight - 115)
DataSource1.Width = (Awidth - 110)
DataView1.Width = (Awidth - 115)
DataView1.Labels = ["Datum", "Artikel", "Artno", "Antal", "Lev_antal", "Lev"]
DataView1.Columns = ["order_sub_delivery_date", "order_sub_item", "order_sub_item_code", "order_sub_amount", "order_sub_delivered_amount", "order_sub_delivered"]
DataView1.View.Columns[1] = 50 'It's here I recieve the error Inte ett fält (Not a field in english)
Update_tableform() 'Populate listboxes based on data collected from db
End
Public Sub Update_tableform()
DataSource1.Table = "SELECT order_sub_delivery_date, order_sub_item, order_sub_item_code, order_sub_amount, order_sub_delivered_amount, order_sub_delivered FROM table_order_sub WHERE order_sub_delivered=0 ORDER BY order_sub_delivery_date"
End
Public Sub Timer1_Timer()
DataView1.Update
End