Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Expertise help for integrate for combo box and flexgrid/ datagrid

Status
Not open for further replies.

Vincentan

MIS
Aug 21, 2002
52
MY
Hi all expertise, I need your help!
currently i have a combo box which load a huge record for additem, this will make the process slow when I add every item for my combo box drapdown list.

my code is here:Dim COn as New ADODB.CONNECTION
Dim Rsc as New ADODB.RECORDSET

Con.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=SQLTABLE;Data Source=SQLSERVER"
Rsc.ActiveConnection = Con.ConnectionString
Rsc.Open "Select item_no from item_sql order by item_no asc", , adOpenStatic, adLockOptimistic

comboItemFrom.Clear
comboItemTo.Clear
MaxREC = 0
Do While Not Rsc.EOF
comboItemFrom.AddItem Rsc.Fields("item_no")
comboItemTo.AddItem Rsc.Fields("item_no")
Rsc.MoveNext
MaxREC = MaxREC + 1
Loop
Rsc.Close
MaxREC = MaxREC - 1
comboItemFrom.Text = comboItemFrom.List(0)
comboItemTo.Text = comboItemTo.List(MaxREC)

Can I use combo box when drapdown it will popup a datagrid control ot flexgrid control interms of using this method for the user to select thier records?
 

Before we go this route, add...
[tt]
Rsc.CursorLocation = adUseClient
[/tt]
Before you open your recordset. This may load your comboboxes faster but it will take your query a little longer to run.

Now if that does not work let me tell you there is not an easy way of catching the click on the down arrow of the combo box. I would suggest a command button to pop up your datagrid or flexgrid.

Good Luck

 
Hey Thanks vb5prgrmr

Is there any sample of this which as you advice for button to pop up the datagrid?

when user select the record from datagris, how do we bring back the value in the variable? does we need to assign as public when form loading?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top