Ask Your Question

How to control listbox data

asked 2016-08-24 01:32:59 +0200

padricLibre gravatar image

updated 2016-08-24 01:37:47 +0200

I have a listbox based on a table view ,tables address(id,GroupNumber,fname,... 20 records) and a lookup table (id,title 7 records). No matter which join I try Group ID(Lkup table) to GroupNumber(data table), when clicking the listbox I get All titles from the Address Table(Data tableT, 3/4 "Family2/3 Business, etc..? How can I control the list to only the values in the lookup Table(7). Tried changing field positions in the source view with no change. Any ideas ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-08-24 01:55:09 +0200

Ratslinger gravatar image

updated 2016-08-24 07:14:22 +0200

When using a list box, text box, etc., in order to fill the table, a process is needed to retrieve the results. The method to use is either macros or what is known as filtering. Filtering is non programming and the easiest. For the best explanation and numerous samples see this post: click here.


That certainly wasn't clear from your post. I've attached a sample. Look at Bike2 form and examine the properties (Data tab). This is basically a query. The other site may be of value to you for filtering (also used in the sample attached).

After looking at your image I believe your problem lies in a missing subform. Look at the structure of the sample in the Form Navigator. Only the list box is on the main form and all the rest are on the subform. Also look at the subform properties to see the connection in the Data tab relating back to the main form.



edit flag offensive delete link more


Thats a lot to read and I will, but, I am able to update the address table its the list box dropdown thats the issue. While I'm reading here are the images.

padricLibre gravatar imagepadricLibre ( 2016-08-24 02:53:20 +0200 )edit

Also look at the properties of the main form and list box to see how it's filled.

Ratslinger gravatar imageRatslinger ( 2016-08-24 03:27:40 +0200 )edit

Answered, tried to explain it but... I tried master slave as you suggest. Had nothing but troubles. Will examine your demo and get back to you. Thanks, Patrick

padricLibre gravatar imagepadricLibre ( 2016-08-24 03:28:51 +0200 )edit

Bottom line. Main form is set to Filter table. List box data is tied to Filter table but fills from query result. List box selection is saved in Filter table. When button is pushed, subform uses filter to retrieve specific results.

Ratslinger gravatar imageRatslinger ( 2016-08-24 03:43:51 +0200 )edit

The other problem you may be having is duplicate entries in the list. This can be solved with an SQL change. You can use SELECT DISTINCT... see this site click here.

Ratslinger gravatar imageRatslinger ( 2016-08-24 04:27:14 +0200 )edit

I've got it working OK with a "TableControl" subform. I can also do it with a full field(normal) subform except even with navigation bar selected on the properties, no navigation bar appears meaning that I can only review one entry from a multiple record group.Any way to add a record selector to the subform. When I try to add the control to the subform it does not display or it wipes out an existing field on the subform. Tablecontrol sub is to small ,have to scroll it. Hope I'm making sense.

padricLibre gravatar imagepadricLibre ( 2016-08-24 06:33:54 +0200 )edit

Added second sample to original answer. Just need to add a Navigation Bar to the subform. Nothing special. Never had problems as you describe when adding one.

Ratslinger gravatar imageRatslinger ( 2016-08-24 07:16:56 +0200 )edit

It Works.!!! Thank you so much. Patrick..FYI I tried a Select Distinct from that link you gave. It didn't work. Image.

padricLibre gravatar imagepadricLibre ( 2016-08-24 08:00:26 +0200 )edit

Ratslinger, At the risk of being a pest, I just wanted to thank you for your help. Considering the depth of your knowledge I really appreciate your willingness to put up with us newbee's. Now the pest, Thought you might like to see the fruits of your help and 2, Is there a way to get rid of the blank entry in the dropbox and can you remove the main menu from the screen ? Image I will work on my question syntax in future.

padricLibre gravatar imagepadricLibre ( 2016-08-24 15:21:46 +0200 )edit

Glad to hear it's working. Blank entry - never figured out a way to remove without using macros. Menu removal - not without macro. See my answer on this post: click here.. Actually your DISTINCT did work. Since you made it with 2 fields combination is distinct. In my second sample, DISTINCT is used for the Color list box.

Ratslinger gravatar imageRatslinger ( 2016-08-24 16:53:52 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-08-24 01:32:59 +0200

Seen: 893 times

Last updated: Aug 24 '16