items selected from my listbox are not saved

R

randria

I have a multiselection listbox in form. whatever items selected from the
listbox appear in one textbox ( bound to a field ). But when I open the table
and check this field, there is nothing stored. What could be wrong ?

Many thanks.
 
R

Rick Brandt

randria said:
I have a multiselection listbox in form. whatever items selected from
the listbox appear in one textbox ( bound to a field ). But when I
open the table and check this field, there is nothing stored. What
could be wrong ?

Many thanks.

How are you getting the values from the ListBox into the TextBox? When more
than one value is selected, are you separating them with some sort of
delimiter.

This is bad design by the way. Multiple related vlaues shoudl be stored in
a separate table.
 
F

fredg

I have a multiselection listbox in form. whatever items selected from the
listbox appear in one textbox ( bound to a field ). But when I open the table
and check this field, there is nothing stored. What could be wrong ?

Many thanks.

Nothing is wrong. Access is working as designed.

Look up MultiSelect in Access help:

When the MultiSelect property is set to Extended or Simple, you can
use the list box's Selected property or ItemsSelected collection
to determine the items that are selected. ***In addition, when the
MultiSelect property is set to Extended or Simple, the value of
the list box control will always be Null.***
 
K

Ken Sheridan

This is a 'road to Dublin' question as the real issue here is, as Rick points
out, that the table design is badly flawed. You are in effect using the
column to which the text box is bound to hold a data structure, which the
relational model forbids, the table not being in First Normal Form (1NF)
whose basis is:

First Normal Form: A relvar is in 1NF if and only if, in every legal value
of that relvar, every tuple contains exactly one value for each attribute.

Loosely speaking, in the formal language of the relational model, a relvar
(relation variable) equates to a table, a tuple to a row (record) and an
attribute to a column (field).

Lets say the table is called Foos and its primary key column is Foo. The
values shown in the multi-select list box are from a column Bar in a table
Bars. What you have is a many-to-many relationship between Foos and Bars. A
many-to-many relationship is modelled by a separate table which references
the primary keys of the two tables, so you should have a table FooBars with
foreign key columns Foo and Bar. Together these two column constitute the
composite primary key of the table.

For data entry you'd use a form, in single form view, based on Foos and
within it a subform, in continuous form (preferred) or datasheet view, based
on FooBars. The subform and parent form would be linked on the Foo columns
and the subform would contain a combo box bound to the Bar column, with a
RowSource property of:

SELECT Bar FROM Bars ORDER BY Bar;

You can now add as many records as you wish related to the parent form's
current record simply by adding new records in the subform, selecting a Bar
value from the combo box in each case.

Ken Sheridan
Stafford, England
 
J

John W. Vinson

What can I do?

">

Well, ask the question of whoever blocked your pc. This newsgroup is for
technical questions about the database software Microsoft Access, so it's the
wrong place.

When you do ask, please indicate what mail software you're using, what version
of Windows, the nature of the blockage, and any error messages you're getting.
Nobody here can see your screen nor do we know anything about your computer
unless you tell us.
 
T

Tom Wickerath

Hi Randria,

As others have already mentioned, it's not a good idea to store multiple
values in one field. Helen Feddema has some tutorials available that you
might want to take a look at:

http://www.helenfeddema.com/access.htm

48. Retrieving Data from Listboxes and Combo Boxes
71. Paired Single-Select Listboxes
72. Paired Multi-Select Listboxes


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

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