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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox or Listbox question..

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi,

With a Combobox, can i have an editable text inout area in a second column next to other info?

What i need is a list of say autocad drawing layouts populating the list / combo, which i've got but i want an additional column where the user can enter details for each one..

If not a list or combo, is there any way of doing this which wont require faffy coding to add new textbox controls for each member of the list?

Cheers,

Paul
basepointdesignzltd..
XP Pro..
Pentium Core 2 Q6600 Quad Core
ASUS P5N-E SLI Motherboard
4GB DDR2 RAM
2 x SLI NVIDIA 8500GT SLi 1024MB DDR2 PCI-Express Graphics Cards
 
One combo box, one text box, and one button should suffice for the moment based upon what you have told us. The combo box holds the drawing name and when user selects a drawing from the combo box, the text box displays its description. If no description or if that description changes, user enters update and click button, where button executes an update statement of some sort... whether file or database.



Good Luck

 
Hi vb5prgrmr,

Thanks for that. So there's no other way of doing it then? I'll have to write the code to add new text box controls for each member of the list then, or just figure out another workaround. ok thanks..

Cheers,

Paul
basepointdesignzltd..
XP Pro..
Pentium Core 2 Q6600 Quad Core
ASUS P5N-E SLI Motherboard
4GB DDR2 RAM
2 x SLI NVIDIA 8500GT SLi 1024MB DDR2 PCI-Express Graphics Cards
 
If you had all your data in a small MSAccess database table, you could use a small Datagrid connected to it and make it look a bit like a listbox.
Fill it with data from a query to form the list of items you want. You can lock some columns and edit in others

Code:
Dim CN As ADODB.Connection  ' Conection tool for Database
Dim RS As ADODB.Recordset ' Recordset tool for Table
Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset
CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\MyFolder\MyDatabase.mdb"
RS.CursorLocation = adUseClient
RS.Open "SELECT * FROM MyTable WHERE  ORDER BY ID;", CN, adOpenStatic, adLockOptimistic
Set MyDataGrid.DataSource = RS

No doubt you could also use a grid with text
 
You just need to use one text box control in an array and index the array using the index of your Combo Box.

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Actually, my thought was to use only one textbox control for both displaying and entering the description information because since you are using a combobox for selection and display, you can only see one record at a time...



Good Luck

 
Something like this?
(Combo1.Listindex)
Eg.
Dim MyDataString(1000,3)
MyDataString(1,0)=Date
MyDataString(1,0)'"Drawing 1 Title"
MyDataString(1,0)'"Drawing 1 Remarks"
MyDataString(2,0)=Date
MyDataString(2,0)'"Drawing 2 Title"
MyDataString(2,0)'"Drawing 2 Remarks"
'and so on up to 1000 titles

Or you can load array from a text file

'Read selected combo item into text boxes
ItemNumber=Combo1.ListIndex
lblItemNumber.caption=ItemNumber
txtDate.text=MyDataString(ItemNumber,0)
txtTitle.text=MyDataString(ItemNumber,1)
txtRemarks.text=MyDataString(ItemNumber,2)

'write to array for selected drawing when save button is pressed or focus on text box lost

MyDataString((Combo1.ListIndex),2)=txtRemarks.text
'then save array in file

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top