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

Auto-populating records in a table.

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


Joined: 12 Mar 2012
Posts: 13

PostPosted: Wed Apr 04, 2012 4:23 am    Post subject: Auto-populating records in a table. Reply with quote

I currently have an employee database where I have a table with "basic details" along with a number of other tables on a "one-to-many" relationship using the <EmployeeID>.

Is it possible that when I create a new employee, using the "Basic Details" form, that a record is created in each of the other table? I guess it would just need to create a blank record with only the <EmployeeID> being added.

I suspect this has been asked before, but I'm not finding a solution when browsing though the topics.

Example I add Joe Smith, EmployeeID 101 in the "Basic Details" form and automatically a record is created in the "Address Details" table with just the <RecordID>, which is an auto-value field and EmployeeID "101. I'd fill in the rest later.
_________________
Regards
PaulDG
Back to top
View user's profile Send private message
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Wed Apr 04, 2012 5:16 am    Post subject: Reply with quote

I'd just put the address data in the same record (table) as the basic data, and enter them when you add an employee. Then you won't have to worry about programmatically adding records to tables.
_________________
LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum
Back to top
View user's profile Send private message
PaulDG
General User
General User


Joined: 12 Mar 2012
Posts: 13

PostPosted: Wed Apr 04, 2012 5:23 am    Post subject: Reply with quote

Thanks for the reply.

Unfortunately my example was a simplistic one. I also have contract, absence, appraisal, emergency contact and various other tables all of which will need to be pre-populated when a new employee is created. In addition to this, addresses can change so employees will have both current and old addresses.

I'm still hoping that there is a way that filling in a form can create a "barebones" record in all of the related tables.
_________________
Regards
PaulDG
Back to top
View user's profile Send private message
Billyray
OOo Enthusiast
OOo Enthusiast


Joined: 06 Mar 2007
Posts: 144
Location: Lake Erie's Shore in Ohio

PostPosted: Thu Apr 05, 2012 6:02 am    Post subject: Reply with quote

Is a barebones record just one that has the foreign key: EmployeeID?

Are all of the subforms on the mainform? If they were, your suforms would already have a new record ready with the foreign key, but the record would only be created if something actually was entered into the subform's record.

If the subforms are not all on the same main form, are they individually called up? How?
_________________
Billyray
using:
Linux distro: Ubuntu 10.04 LTS, Lucid Lynx, OOo Base 3.3, connected to MySql database using Java jdbc (note: ONLY sun-java-6-1.6.0_22 jre works right), and converted from MS Access 2003.
Back to top
View user's profile Send private message
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