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

Combobox feeding text box help

Status
Not open for further replies.

ribbons

Technical User
Apr 26, 2007
113
0
0
US
I have a combobox, whose selections fill a textbox that is bound to the database. This works great, except now the users want to be able to "stack" selections from the combobox in the textbox, selection 1 and then selection 2 ,etc. etc. sentence after sentence. I have no idea how to do this. Any suggestions?

ribbons
 
What are you using to do it now?

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I have a combobox bound to a lookup table. Each selection from the combobox is placed in the textbox and thus stored in the database (I couldn't figure out how to bind the combobox to the DB). The users want to be able to pick more than one selection from the combobox and store ALL of the selections to the database. Make sense?

ribbons
 
I know what you were trying to do, I was just wondering how you were doing it so I didn't suggest something that required a full rewrite of your current code.

How about on the event you use to populate the textbox you do something like:
Code:
If Trim(Text1.Text & "") <> "" Then
Text1.Text = Text1.Text & ", " & CboValue.Text
Else
Text1.Text = CboValue.Text
End If
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I'll give it a try tomorrow and let you know!

By the way, do you have any idea how to bind comboboxes?

Here's how I bound the text boxes.

Code:
Dim oText As TextBox
  'Bind the text boxes to the data provider
  For Each oText In Me.txtFields
    oText.DataMember = "Primary"
    Set oText.DataSource = PrimaryCLS
  Next

I've done this before, but have forgotten how.

ribbons
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top