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

How to save a foreign key using a combo box (dropdown)?

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


Joined: 05 Sep 2009
Posts: 2

PostPosted: Sat Sep 05, 2009 4:49 pm    Post subject: How to save a foreign key using a combo box (dropdown)? Reply with quote

I am a modest MS Access/ VBA programmer. I am very new to OOo but think it would be great to recreate some MS Access mdb's in OOo Base 3.1 odb's.

In MS Access, the Combo Box has properties for "Bound Column" and "Column Width" and is thereby able to contain multiple columns per row (and a column - i.e. a key column - can be hidden by setting "Column Width="0"). Using these Combo Box properties, it is easy to save the key (Bound Column) of the selected row as a foreign key in another table when a meaningful description is selected by the user.

I do not see the same properties in OOo Base Combo Boxes. So, how do I save the key and not the description (which could potentially later change so I only want to change it in one location).

An example...An Address table with a foreign key to a Type table depicting the type of record (family=1, friend=2, Colleague=3, Business=4, Medical=5, etc). So what is the code I need that will display the Type descriptions but save the key of the selected Type in Address, and vice versa upon loading the form to read the saved key and display the associated description in the list of Type descriptions?

Sample code would be awesome!!!
Many thanks in advance for any attention.
_________________
Can't do it if you don't try!
Back to top
View user's profile Send private message Yahoo Messenger
RPG
Super User
Super User


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

PostPosted: Sun Sep 06, 2009 1:35 am    Post subject: Reply with quote

Hello

Activate the wizard on the toolbar
create a listbox and the wizard will help you to select the parts.

I think it is better to use a listbox then a combobox
read the tutorial from Benitez and visit Sheepdogs

Use also the "form navigator". Button is on an other toolbar.

Romke
Back to top
View user's profile Send private message
TECenery1
Newbie
Newbie


Joined: 05 Sep 2009
Posts: 2

PostPosted: Wed Sep 09, 2009 11:32 am    Post subject: Thanks so much Reply with quote

Very interesting! I will give it a try and let you know how it turns out!
Thanks
_________________
Can't do it if you don't try!
Back to top
View user's profile Send private message Yahoo Messenger
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