Hallo all,
why don't I see the datagrid content the first click in the listbox and
twice the second time?
Here is my code. I'm at the end of my mental resources.
Private Sub ListBox5_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ListBox5.SelectedIndexChanged
'opmaak(oproepen)
frmDatagrid.opmaakdatagrid()
strTekst = ListBox5.Text.ToString
Try
daVastBewVJ = New OleDb.OleDbDataAdapter("select * from tblVast where
year(datum)= 2004 order by soort", cn) ' order by soort", cn) 'and datum
where (year(datum)=now())", cn)
daVastBewVJ.Fill(dsVastBewVJ, "tblVast") 'datagrid vorige jaren
' DataGrid openen
frmDatagrid.DataGrid1.DataSource = dsVastBewVJ.Tables(0)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
' caption van formulier
frmDatagrid.Text = " Eenmalige uitgaven voor " & strTekst
i = dsVastBewVJ.Tables(0).Rows.Count
frmDatagrid.DataGrid1.Height = ((i + 1) * 20)
frmDatagrid.Height = 70 + frmDatagrid.DataGrid1.Height
frmDatagrid.ShowDialog()
End Sub
A thankful Hyphessobrycon, the new fish in the VbOcean (and drowning)