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 fill-in fields on a form?

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


Joined: 24 Mar 2003
Posts: 1290
Location: Te Ika a Maui, Aotearoa

PostPosted: Mon Apr 10, 2006 2:26 pm    Post subject: Auto fill-in fields on a form? Reply with quote

This is a real kl00less n00bie type question, but if I have a form, how do I get some fields automatically filled in based on user entry in other fields? For example, if a user types in their Staff ID, how do I get the "first Name", "Last Name" fields filled in, or the "Project Name" field and Project ID" fields after the user enters "Job Nr"?
_________________
Noho ora mai, ka kite ano.
What Is A Pieriansipist?

OOo 2.4/XP Pro SP2 / OOo 2.3.0.1/OpenSuse 10.3
Back to top
View user's profile Send private message Visit poster's website
heatherbowater
Newbie
Newbie


Joined: 19 Apr 2006
Posts: 1

PostPosted: Wed Apr 19, 2006 1:31 am    Post subject: Reply with quote

This is the sort of thing I want to know, too. It's probly just a termnolgy thing, but it would be nice to know how to do it.
Back to top
View user's profile Send private message
DrewJensen
Super User
Super User


Joined: 06 Jul 2005
Posts: 2616
Location: Cumberland, MD

PostPosted: Wed Apr 19, 2006 4:32 am    Post subject: Reply with quote

Well, I am not sure if I understand the question -

As far as I can see you have a couple of choices:

Default property for each control
Every UI control has a default setting available via the property inspector, or at runtime via the API.

CheckBox -> Default Status
TextBox -> Default Text
FormattedField -> Default Value
ComboBox -> Default Text
ListBox -> Default Selection
......
etc.

Now for a second way. In Base using the table design editor you can assign a default text value to a column. This text will be entered into any control that is bound to this column, when a new record is inserted into the table. Only string literals are allowed for this default value, but a numeric field will convert an appropriate string to a number, and a date field the same so you can pretty much create a default for any column type. This IS NOT the same as having a default value on a column at the database engine level, this default text is used only by Base forms and data view grids.

Finally, you can create a macro that will fire on the action of inserting a record. In this macro you could set any control any way you like.

Something that won't work:
You can create default values at the database engine level. How you do this would depend on the engine (server) that you are connecting to. With this apporach the Base form will not, as far as I know, pick the value up for display. I don't really think it could, since the value doesn't exist until the new reocrd is posted to the database.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bajintas
General User
General User


Joined: 12 Apr 2006
Posts: 10
Location: Tasmania

PostPosted: Wed Apr 19, 2006 3:53 pm    Post subject: Reply with quote

Hi,
Watching your thread and wondering if theres a way to mimic the way this would be done in Access. That is, by editing the Control Source and Row Source properties of the controls.

The Row Source of "StaffID" (The StaffID control would be a ComboBox) would be a SELECT statement something like SELECT Staff.StaffID FROM Staff;

The Control Source of "FirstName" and "LastName" would be "StaffID".
The Row Source of "FirstName" would be something like SELECT Staff.StaffID, Staff.FirstName FROM Staff.
and something similar for LastName.
I cant find anything like this in Base but then, I am very new to Base
This seems to work quite well in Access but I'm not suggesting that this is the best way.
Its because of "The Microsoft Way" that I'm trying to learn Base.
_________________
Bob
Back to top
View user's profile Send private message
linchat
Newbie
Newbie


Joined: 19 Apr 2006
Posts: 2

PostPosted: Wed Apr 19, 2006 5:20 pm    Post subject: Auto Date Reply with quote

I am glad this subject came up! Is it possible during table design to auto-date by setting the default value on the table? How can this be done on a form?


Thanks
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