[Solved] Setting up a combo box

Creating and using forms
Post Reply
Mike R
Posts: 4
Joined: Thu Jul 24, 2008 10:11 pm
Location: cabinetmaker

[Solved] Setting up a combo box

Post by Mike R »

I'm a newcomer to OO. I have a little experience with FileMaker Pro and Access.
I'm trying to set up a combo box for my business database, where I can set a group of sources for entry into the form. I cannot figure out where the list is to be formed, and placed, to link to the combo box in the form.

Any help will be appreciated!

Mike R

OO 2.4
Windows XP
Last edited by Mike R on Sun Jul 27, 2008 2:17 am, edited 1 time in total.
OOo 2.4.X on Ms Windows XP
User avatar
voobase
Volunteer
Posts: 97
Joined: Tue Jan 15, 2008 3:07 pm
Location: Australia

Re: Setting up a combo box

Post by voobase »

Hi Mike,

The easiest way to supply a list to a combobox is by having that list stored in a separate table. When working with your form the easiest way to implement the combobox is by having the "wizard" turned on in the "form control" toolbar. When you are editing your form in design mode, the other handy button to know about is the "form navigator" button on the "form design" toolbar.

The usual method would be to select which form you wanted the combobox to be in (from your "writer doc" mainform and subforms) by using the "form navigator". When you select and draw a combobox on your form the wizard will launch and you can then select which table will supply the list for the combobox. You can then also select if you want the selected value to be put in another field of the table that is the datasource for the form that the combobox is sitting in. To check your combobox properties you can then right click on it in the "form navigator" (or on it in your form if it is not linked to a label) and look at the properties.

Cheers

Voo
OOo 2.3.X on MS Windows Vista
Mike R
Posts: 4
Joined: Thu Jul 24, 2008 10:11 pm
Location: cabinetmaker

Re: Setting up a combo box

Post by Mike R »

Voo,
Thanks so much for your reply. The way you described it is exactly the way I THOUGHT it should work. I tried to do what you said, but I'm still having a problem.
Let me lay out what I'm doing, and maybe you can tell me where I'm going wrong:

We'll set up a very simple form: Customer Name, where I will type in the name, and Source, which will be a drop down combo box with three options: Yellow pages, web search, and referral
1. New Database
2.Table>Create Table in Design View: I set up 2 fields, Customer Name and Source. I leave these as Field Type: TEXT. I save this table as Table 1, and the ID field is added automatically.
3. Table>Create table in Design view: 3 fields, all text: Yellow Pages, websearch, referral, Save as Drop, ID is added.

Now, I'm lost. I have tried setting up my form with both the wizard, and the design method, but I can't get the link to work properly. The choices I get to link the combo box with the Drop table don't seem to say what I need it to do. I looked at the SUBFORM option, but that doesn't make sense to me, either.

If you can walk me through this simple setup, I can certainly extrapolate to my big one. Sorry to be so dense. I'm a cabinetmaker, not a computer whiz!

Mike
OOo 2.4.X on Ms Windows XP
User avatar
voobase
Volunteer
Posts: 97
Joined: Tue Jan 15, 2008 3:07 pm
Location: Australia

Re: Setting up a combo box

Post by voobase »

Hi Mike,

I think I know where you are going wrong. The second table that you create should not have the options you want to select put in as fields but rather as "data" after the table has been created. You are using design mode to create your tables which is good (the wizard i've never found had the fields I needed).

Table 1 you are going about it the correct way... almost. There is a further trick to do with the primary key "ID". After you have pressed save and alowed the "ID" field to be created automatically you must click on that field and down the bottom select "auto increment". This means that the "ID" field will automatically number upwards with every new record and meet the requirements that the primary key must be unique. The two other fields are what you want, the "customer_name" and the "source". The "source" will be where you leave the result of the combobox once that is working properly in your form.

Table 2. You will only need 2 fields. One called "combobox_source" and the other is the primary key "ID" field. Again let the "ID" field be created automatically and then click on "ID" to change it to autoincrement.

Once table two is created, double click it and you will be able to enter data into the field. Your three options will then be recorded on a new row of the table, for example ID - 0 will have "yellow pages", ID - 1 will have "WebSearch" next to it and ID - 2 will have "referal" next to it.

Now you are ready to create your form. Use the wizard to create the form and your form will have only two fields, "ID" and "Source". Don't worry about subforms yet. Once the wizard is finished, close down the form and go to open it again but this time right click on it and choose "edit". This opens the form in "design mode".

From here you can follow my original instructions. Determine which toolbar is which and push the button for the wizard. Draw the combobox on your form and follow the wizard through. There is a button on the "form design" toolbar for turning design mode on and off. This is very handy.

I've got to rush to work (don't worry, I don't work with computers either) but let me know how you go and if you need more help with the form.

Cheers

Voo
OOo 2.3.X on MS Windows Vista
Mike R
Posts: 4
Joined: Thu Jul 24, 2008 10:11 pm
Location: cabinetmaker

Re: Setting up a combo box

Post by Mike R »

Voo,
I think I've got it, thanks to you. It took a bit of finagling: I had to remove the text field "source", and drag my listbox into the same location, but it seems to be working the way it should.

Thanks for your help. I really appreciate the time you've taken to smooth my way!

However, I've run into other problems. I'm ranting on a separate post.

Mike
OOo 2.4.X on Ms Windows XP
Post Reply