By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,409 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

Listbox selection shows detail

P: n/a
I would like to have a form that lists current addresses being used.
On this form I would also like to have a command button that would
allow the user to add an address if they do not see it listed.

Is it possible to have the form show the list box (which is a
combinination of the address and city/state/zip), along with the
detail fields address and city/state/zip?

I guess I was thinking of have the listbox display and then when the
user clicks an entry from the listbox, the detail fields are filled in
with its data.

From there if a user wants to add a new address, they would click add
and the focus would go to the address field and the user would enter
the address and then city/state/zip. The new entry would then appear
in the listbox and the user can select it to return the information to
a calling form.

Does this make sense or would there be a better way to display all
current addresses, allowin the user to select one from the list or add
a new one? I tried a few things but could never get the listbox to
requery after a new entry was made, plus I don't want to have 3 forms
open just to add an address.

Help!!

Thanks!
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Annette Massie wrote:
I would like to have a form that lists current addresses being used.
On this form I would also like to have a command button that would
allow the user to add an address if they do not see it listed.

Is it possible to have the form show the list box (which is a
combinination of the address and city/state/zip), along with the
detail fields address and city/state/zip?
Yes. In the OnClick event of the listbox you would write the code to 1)
find the record in the table and 2) fill in the address fields.
I guess I was thinking of have the listbox display and then when the
user clicks an entry from the listbox, the detail fields are filled in
with its data.

From there if a user wants to add a new address, they would click add
and the focus would go to the address field and the user would enter
the address and then city/state/zip. The new entry would then appear
in the listbox and the user can select it to return the information to
a calling form.
Most likely your address fields will be unbound. IOW, the form does not
have a recordsource thus the fields, when displayed, are not directly
linked to a table via the Data tab's ControlSource. If this is the case,
you might want to have a Save button....to save any changes to an address
that already exists or a new address.

In the Save button's OnClick event you would write the data to the table
and then enter
Me.ListboxName.Requery

One problem with the listbox is getting the listbox to move to, display,
and highlight the current record selection once you do a requery, You may
have to futz with that.

Does this make sense or would there be a better way to display all
current addresses, allowin the user to select one from the list or add
a new one? I tried a few things but could never get the listbox to
requery after a new entry was made, plus I don't want to have 3 forms
open just to add an address.
There are some issues that you should address with listboxes. One is
column size. If the column size is not wide enough, it will cut off the
end of the line. Of course, it will be filled in the fields...but as the
person is looking at the list, the person won't see all of the info..

Also, listboxes and combos are great for small sets of data. When you
start displaying large amounts of records the response time goes down in
scrolling through the records. If you have a 1000+ addresses you are
displaying, getting to the bottom of the list may be slow.

It's also eaeser to sort the data if it is in a form instead of a listbox.


Help!!

Thanks!


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.