Populate a listbox manually - help!

  • Thread starter Thread starter Anisah
  • Start date Start date
A

Anisah

Hi,

I have a form with a number of fields that will be filled
out by the user; for example, first name, last name, birth
date, etc. (It's more complicated than that, but just for
an example).

When the user clicks an "Add" button, these fields are
used to create objects and records in a database behind
the sceens. That part works fine, no problem.

When finished creating all the object, I'd like to take
the fields filled in by the user, and populate a list box
with those values (first name, last name, etc.) for
display purposes only. And for the life of me I can't
figure it out.

I've tried putting all the values in a string and adding
the string to the listbox, but then the multiple strings
(one per person) don't line up at all.

Any suggestions?

Thanks in advance!!
- anisah
 
Hi,

I have a form with a number of fields that will be filled
out by the user; for example, first name, last name, birth
date, etc. (It's more complicated than that, but just for
an example).

When the user clicks an "Add" button, these fields are
used to create objects and records in a database behind
the sceens. That part works fine, no problem.

When finished creating all the object, I'd like to take
the fields filled in by the user, and populate a list box
with those values (first name, last name, etc.) for
display purposes only. And for the life of me I can't
figure it out.

A Listbox isn't really a very good tool for this purpose! The rows of
a listbox ordinarily will contain multiple values of the same field,
not different values from different fields.

You might consider using a Subform based on the table; set the subform
to Single (rather than the default datasheet) view, and put textboxes
one above the other bound to the table fields. This subform can be
editable or not as you choose. Its Master/Child Link Fields should be
whatever field uniquely identifies the record currently on the
mainform.
 
Hi Anisah

Didn't you say you are creating records containing the data which has been
typed in?

Why then can you not base your listbox's RowSource on a query which returns
those fields from the table(s) to which they were written? Then, after
writing the new record(s), you simply have to say:
MyListBox.Requery
 
Back
Top