Text Box is only saving the first word of the field

  • Thread starter Chris via AccessMonster.com
  • Start date
C

Chris via AccessMonster.com

I miss quoted this earlier.......


I have a form with a list box, a text box and two buttons in the middle to
add or remove keywords from the list box to the text box.

The list box lists all the possible skills. The user highlights a skill and
clicks on the button to add that skill to the Text box. They can select up
to 9-skills . Once the skills are in the Text box, and they are vertically
listed
like this:

java
html
db2

I need to click a button that would save all the skills in the text box to
the field in my table.
Now it is only saving the first skill.

How do I get the vertical list in my text box to save Horizontally for
instance, comma delimited?:

java, html, db2

Thanks for your help...

Chris
 
G

Guest

What you are calling a text box can't be a text box. My guess is it is
another list box. What you are describing can't be done with a text box.

In any case, you should not be trying to save multiple items into one field.
You really should have a child table that has the ID of the parent table as
the foreign key and the skill code.

Have a look at that text box and let me know if it is truely a text box or
if it is really a list box.
 
G

Guest

It is only saving the first one because it is the current value for the list
box.
You must cycle through all the records.
I would use a For loop to loop through all the records in the listbox.

For x = 0 to ListBox1.ListCount-1
If ListBox1(x) = True Then
'Add the record to the table
'Enter the command you are currntly using to append to the table,
'Replacing the ListBox1 with the specified ListBox1(x)
End If
Next x



jmonty
 
G

Guest

My guess is that the values ARE all being saved. For the values to appear
"vertically" in your text box, there is presumably a carriage return
character after each one. If you then open the table, by default it will
show only the first "line" in the field. If you click in the field, then use
the down arrow, you should see the other values. Or, simply increase the
height of the displayed records so you can see it all.

To get commas between the values instead of carriage returns you'll need to
modify the code behind the relevant command button. You'll need to post the
code if you want someone to tell you exactly what to change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top