[Solved] List Box not clickable

Creating and using forms

[Solved] List Box not clickable

Postby JJack » Wed Mar 22, 2017 2:40 am

Hi,
Completely new to Base (or Access).
I know SQL.
I have a baseball stats SQL DB. Base database created and linked to it. The link works great.
Trying to create ListBox in a form.
Two tables. List of players, with primary key named player_id.
Second table is a stat listing. It has a field called hitter_id which is a foreigh key of the tbl_player.

I want to create a form that gives me stats of players, but first, I want to list all the players.

In the list box control, under data, I have:
Data field: player_id
Input required: Yes
Type of list contents: Sql
List content: SELECT "fullname", "player_id" FROM "stats"."dbo"."tbl_players"
Bound field: 1

For the result, I see the first player from list, which confirms the query is correct, but listbox is gray-ish and is not clickable. I can't get the other players.

What am I doing wrong? I don't believe I have seen this problem posted anywhere.
Last edited by RoryOF on Wed Mar 22, 2017 6:45 pm, edited 3 times in total.
Reason: Added green tick [RoryOF, Moderator]
OpenOffice 4.1.2
Windows 8
JJack
 
Posts: 5
Joined: Wed Mar 22, 2017 2:19 am

Re: List Box not clickable

Postby Villeroy » Wed Mar 22, 2017 2:28 pm

How about property "Drop Down" on the "General" tab?
Do you get the expected record set when you test the query? Just click the [...] button near the list content box.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24386
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: List Box not clickable

Postby JJack » Wed Mar 22, 2017 2:45 pm

Thank you for the reply Villeroy.
The DropDown option on General tab is at Yes.
And the query does work and provides the complete list I am looking for.
OpenOffice 4.1.2
Windows 8
JJack
 
Posts: 5
Joined: Wed Mar 22, 2017 2:19 am

Re: List Box not clickable

Postby Villeroy » Wed Mar 22, 2017 3:39 pm

And the underlying record set of the form (not the list box) is editable?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24386
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: List Box not clickable

Postby JJack » Wed Mar 22, 2017 3:45 pm

Funny thing, that was the first thing I tried on the form!
For testing, I just created a combo list from the same player table, and it works correctly, it gives me the full list.
OpenOffice 4.1.2
Windows 8
JJack
 
Posts: 5
Joined: Wed Mar 22, 2017 2:19 am

Re: List Box not clickable

Postby Villeroy » Wed Mar 22, 2017 4:22 pm

JJack wrote:For the result, I see the first player from list, which confirms the query is correct, but listbox is gray-ish and is not clickable. I can't get the other players.

After loading the form shows the first record of its record set. If the set is empty you see a blank new record and the list box should not show any player name. If the form does not allow insertion of new records, there is nothing to do for this form and everything is disabled.

If the form is prepared to insert new records only ("Data" tab of form properties), modification needs to be allowed as well. Apart from that, the list box may be disabled by its "Enabled" property but you might have double-checked this already.

For a regular edit/delete/insert form, adding some dummy data to the tables may help to unveil the cause of problem. Do you see the other field data represented correctly?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24386
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: List Box not clickable

Postby JJack » Wed Mar 22, 2017 4:56 pm

For now, the only thing I wanted to do, was show stats for one specific player. (select player, then show data from another table based on the selected player) I am not looking (yet) to insert, edit data, I just want to select.
The goal was to set the listbox to be kind of a parameter from which another query would present results.
Maybe the listbox is not the proper tool in this case?
And yes, the Enabled category is set to Yes.
OpenOffice 4.1.2
Windows 8
JJack
 
Posts: 5
Joined: Wed Mar 22, 2017 2:19 am

Re: List Box not clickable

Postby Villeroy » Wed Mar 22, 2017 5:02 pm

You should create a subform and link it to its parent form by the common player id. List boxes select some item by name and write the corresponding key value into a record.
[Example] Relations reflected by list boxes in forms [small tutorial on subforms and list boxes with example document]

Filtering by list box value is a very frequently asked question. You can make it happen by means of a dummy record storing the filter criteria. Then you link your list box to that dummy record and add a subform with dependent data. Search this forum for "power filtering".

The built-in method is a little bit clumsy: Use a text box "player name" with property "filter proposal". When you turn on the form based filter (a button on the form navigation toolbar), the text box turns into a listbox of unique items. You enter filter criteria into the form and then turn off the form filter mode.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24386
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: List Box not clickable

Postby JJack » Wed Mar 22, 2017 5:14 pm

I will try your solution and see the tutorial
Thank you for the details and guidance.
OpenOffice 4.1.2
Windows 8
JJack
 
Posts: 5
Joined: Wed Mar 22, 2017 2:19 am


Return to Forms

Who is online

Users browsing this forum: No registered users and 3 guests