473,396 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

why don't I see the datagridcontent the first click in the listbox and twice the second click?

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)
Nov 21 '05 #1
0 828

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Zyrthofar Blackcloak | last post by:
Hi everyone I have a listbox with more items in it than is printed on screen. I need the index number of the first shown item to move another listbox to the same position... Explained differently,...
2
by: =?Utf-8?B?SGV6YWw=?= | last post by:
Hi, I am trying to add a new record to a table but everytime I click the button, somehow it saves the record twice... I've created a stored procedure to insert records into a table and I called...
2
by: vinod allapu | last post by:
hi all, i am trying to generate a report, iam using sql server 2000 and Asp.net 2.0. First to select the columns iam using the list box... as we can order by the query result from the...
7
by: onyris | last post by:
Hi guys, have a form which displays all the records i have in my database , and a search box for the user to search for a specific one . On the search button, i run a macro which opens another...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.