OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

List boxes. Help please!!

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
fcarringtons
General User
General User


Joined: 29 Sep 2009
Posts: 5

PostPosted: Fri Oct 02, 2009 11:40 pm    Post subject: List boxes. Help please!! Reply with quote

If this a repeat........... sorry my last effort just disappeared.

Ok. I basically made an 'address book' table. Then a form of the same name.
I thought id simplify things so that when I clicked the field 'title' on the form a list box would open up with the option of Mr. Mr. Miss.

So I created a table. The first field called 'id' and made it a primary key with Field Type Interger[INTERGER]
Next Field: typed 'Mr' Field Type Text[VARCHAR] and did the same for Mrs. Miss etc
Saved the table and called it 'One' (so I would not cofuse things on here)

Next I opened my address book in forms in edit mode. With wizard on selected I open up a list box on the form.

Control I select 'one' (the table with Mr. Mrs etc in it)
Existing fields I select 'id'
Field from the value table I select 'title'
field from the list I select 'id'

Click finish. Go out of edit mode. Select the list box and I get just a blue box in the list box.
Try again.
Control 'one'
Existing fields. 'id'
Field from the value table 'record id'
Field from the list Table 'id'
click finish
Again just a blue box in the list box.

Where am I going wrong guys? Rolling Eyes
Thanks in advance for your help. Smile !

These are just two of the MANY variations I have tried. Not quite the hair pulling out stage yet, but getting there.
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Sat Oct 03, 2009 1:14 am    Post subject: Reply with quote

Hello

read this tutorial about forms.
http://www.geocities.com/rbenitez22/OOo/index.html

activate the wizard for listbox with a button right on a toolbar
Use this wizard for listbox.

Romke
Back to top
View user's profile Send private message
fcarringtons
General User
General User


Joined: 29 Sep 2009
Posts: 5

PostPosted: Sat Oct 03, 2009 4:43 am    Post subject: Reply with quote

RPG wrote:
Hello

read this tutorial about forms.
http://www.geocities.com/rbenitez22/OOo/index.html

activate the wizard for listbox with a button right on a toolbar
Use this wizard for listbox.

Romke


Ok. Thanks for the reply. The Tutorials were not of any use. Could not find anything relevant to list box wizards etc

A for using the wizards, as you may have read above that that is my problem, I cant get the wizard to produce a list box, well at least one that works anyway.

Thanks anyway for taking the time to reply. Smile
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Sat Oct 03, 2009 5:08 am    Post subject: Reply with quote

Hello

It was difficult for me to understand what you wrote in your first post. After a time and second post some thing come more clear to me.

You have a table with three values: Mr,Mrs,Miss. This table have also three ID.

In your address table you must have a field with a value what make the different between MR,Mrs or Miss.
This field is bind to the ID of the little table.
Read carefull what the wizard asked. It is clear you have not answered in the good way.

You can use the combobox also.

For the combox and the listbox you can add those values in the general tabppage of the control.

Romke
Back to top
View user's profile Send private message
fcarringtons
General User
General User


Joined: 29 Sep 2009
Posts: 5

PostPosted: Sat Oct 03, 2009 8:05 am    Post subject: WORKING AT LAST Reply with quote

Sorted. At long long last.

Ok. A how to for those having the same problems as me. This is what I was looking for.
Objective make a list that you can choose from in a list box. This one works.

1. Make a Table for your list's data.

Click Tables.
Click. Create in design view.
Click in 'field name' and give it an appropriate name. In my case 'Title'.
I kept 'field type' in Text[VARCHAR] (you dont enter any data at this point)

Click one place down in the fields (just under 'title)
In this field call it 'id'. Change vale from Text[VARCHAR] to interger. Set it as a primary key and select 'auto value' at the bottom. (so thats the primary key at the underneath 'title' field and not the top as you would expect)

Done! Save this file/table. I called my new table 'Title'.

2. Enter data into your new Table. Your choices for your list box.

Open it up again, NOT in design view, this time to enter data.
Under 'title' I called one field Mr
Next field down I called Miss etc
When you have all the appropriate fields save the file.

3. Thats your Tables & choices made. Now to use them.

Go into forms and open up the form where you want the list, obviously open it up in edit mode.
Ensure the 'wizard' icon is selected (yes the one with the wand}
click the list icon and drag a small oblong box where you want it on the page.
The List Box Wizard will open up.

(a)Select the table you just made. In my case it was called 'Title' click Next

(b) Select the field in which you put the list in. In my case I called it 'Title' remember?
Click next.

(c) Now the record/form you are viewing has a primary key. I dont know what yours is called my mine was called 'record id' whatever yours is called select that for the left hand box.
Now in the right hand box you should only have two choices. Pick the one that has the name of your primary key in the table you just made with all your choices. I called mine 'id'. Click finish.

Go out of edit mode.

Enjoy your new list box!

I have tried not to waffle too much. But at the same time tried to make it clear as possible. To the purist's or experts this may not be the best way but my view is once you have something that works you can work out the rest yourself!

If you find this usefull I would appreciate some feedback please! Thanks!!
Back to top
View user's profile Send private message
cyningstan
General User
General User


Joined: 02 Nov 2009
Posts: 9
Location: Kingston upon Hull, England

PostPosted: Mon Nov 02, 2009 8:27 am    Post subject: Reply with quote

I found it very useful when I read it correctly. In my first attempt I tried to apply the technique to combo boxes, but that doesn't appear to work. A list box is the appropriate option.

In fact a bit of experimentation with the SQL in the control's properties has made the technique go further. Fields can be added together to make a composite field for the list box, which is very useful in some situations. In my casework database I used the wizard to create a list of resident names from the resident file, then altered the SQL it generated to something like:

SELECT "Name" + ', ' + "Address" FROM "Resident"

So now I get a resident name and address in the list. As with your example, a separate ID field is then put into another table that the form is designed to access.
_________________
Damian
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group