このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


ListBoxes, ComboBoxes- Open Office (Data) Base Tutorials AUTHOR'S MAIN SITE   > > > > >   TABLE OF CONTENTS for Open Office database tutorials.

Open Office 2 Base (database) Tutorials
Data Validation. ListBox. ComboBox.

Filename: fdb1listb.htm

You may find that the database 含むd in OpenOffice delights you as much as it has me. This page tries to help you use it.

Remember that Open Office, 含むing ooBase, is 解放する/自由な. Don't let that fool you, though. Big organizations, 政治の and 非軍事の, have 可決する・採択するd it as their 基準 office 控訴... and saving million$, but still Getting The 職業 Done. And making things 平易な for 使用者s on different 壇・綱領・公約s... Linux, Mac, Windows all spoken here!

There's more about ooBase in the main 索引 to this 構成要素.

LibreOffice? Open Office? This link will take you to a sidebar about the similarities and differences, the 問題/発行するs.

Whether you are using OpenOffice or LibreOffice, I think you are wise, and hope that my tutorials will be 平等に useful to you.

This page is "browser friendly". Make your browser window as wide as you want it. The text will flow nicely for you. It is easier to read in a 狭くする window. With most browsers, 圧力(をかける)ing 加える, minus or 無 while the 支配(する)/統制する 重要な (ctrl) is held 負かす/撃墜する will change the texts size. (大きくする, 減ずる, 回復する to default, それぞれ.) (This is fully explained, and there are more tips, at my 力/強力にする Browsing page.)

Page contents © TK Boyd, Sheepdog ソフトウェア, 3/06- 12/18.



Is this up to date?

This essay first appeared in 2006. (That explains why some illustrations are 時代遅れの.) I have tried to be responsive to comments over the years.

In December 2018, I am working through the essay, trying the 概念s discussed in a freshly 任命する/導入するd OpenOfiice 4.1.6 環境, on a Windows 10 (Sigh. Ich.) machine. (And tweaking the essay.) qFIX if you 遭遇(する) THIS 公式文書,認める after 28 Dec 18, please 令状 (link at 底(に届く)) say "直す/買収する,八百長をする 'qFIX if you 遭遇(する)' in fdb1listb.htm". Thank you!



Data validation: Overview

Many times there are only a 限られた/立憲的な number of valid 入ること/参加(者)s for a given field in a (米)棚上げする/(英)提議する you have created. For example, if you have collected data on a group of people, and you have a 推論する/理由 to want to 割り当てる each person to a 伝統的な gender, then you'll have a field which should only 持つ/拘留する "male" or "女性(の)", or some other pair of codes, e.g. "m"/"f". Often, you may wish to know that, but have no 合法的 need to. consider 追加するing その上の 選択s... "not 記録,記録的な/記録するd", "other".

Continuing with our example: It would not give a human any trouble if いつかs you 記録,記録的な/記録するd an individual as "male" and other times you 記録,記録的な/記録するd him as "man". Computers do not 栄える on inconsistency. It would be best if you used one and only one code for each gender throughout the database. (米)棚上げする/(英)提議する 強制s are an important 道具 you can use to guard against 無効の 入ること/参加(者)s. They are discussed どこかよそで. In this essay, we 調査する other 道具s. (公式文書,認める the subtle differences... it is 平易な to get 混乱させるd between the 選択s.)

"Data validation" is something for which you should 努力する/競う. A given datum may be wrong, i.e. you enter "女性(の)" for Santa Claus, but as long as you've used the 権利 code, the data is valid. To put it another way, a datum is valid if you have used one of the 許すd values for the field.

The "male"/"女性(の)" example is a nice simple one. (井戸/弁護士席, it was. 陳謝s to any reader who would rather I didn't say that... I DO realise that for some it is NOT a simple 問題/発行する. My thanks to the team who produced the excellent TV 演劇 "バタフライ" for helping me learn more. (It could have been cheap and dumb, but it wasn't.))

Data validation can be more subtle. Take, for example, US Social 安全 numbers. Every US taxpayer has an ID 割り当てるd by the 政府. A typical SSN is 044-44-8365. An individual's SSN always consists of three digits followed by a hyphen followed by two digits followed by a hyphen followed by four digits.

Whether you are 取引,協定ing with simple 事例/患者s (like "m"/"f") or more コンビナート/複合体 ones (SSNs), databases 供給する 道具s to 実証する data as it is entered, so that . 公式文書,認める that: "無効の data can be 除外するd from your (米)棚上げする/(英)提議するs". Sounds 価値(がある) the trouble, when you put it like that, doesn't it?

This tutorial 供給するs answers for the simple 事例/患者s. I'm still trying to master 実証するing things like SSNs!

In this tutorial we will pretend that we've been given the 職業 of keeping 跡をつける of the 指名するs of the children …に出席するing a 確かな prestigious 搭乗 school where every child is a member of one of the に引き続いて "houses", (i.e. 内部の 部隊s of the school): Ravenclaw, Gryffindor, Hufflepuff or Slytherin

We'll build a small (米)棚上げする/(英)提議する, and 供給する a data 入ること/参加(者) form which won't 許す us to enter an 無効の value for the child's house. We'll first do this by using a ListBox. We'll look at the shortcomings of a ListBox, and try an 代案/選択肢, the ComboBox. We'll look at its shortcomings, and then go on to a more 前進するd 解答 to the problem: the setting up of 強制s on the (米)棚上げする/(英)提議する. I'm afraid that the tutorial ends with an 控訴,上告 to more competent "Base" (ooBase) programmers for some help with a few problems which I have not yet solved. (!)

===

By the way.... Don't get carried away with data validation. It might be tempting to put a validation 支配する on the 郵便の (Zip) code in a database of 演説(する)/住所s. The 支配する could say that the code must consist of 5 digits. 罰金... until you try to 追加する someone to your database who doesn't live in the USA! We've all been annoyed by 取引 with 会社/堅いs whose computers "can't" を取り引きする something in our lives because their database doesn't 許す the data to be entered 正確に for our circumstances. This is often 予定 to 不正に designed data validation. Don't 追加する to the problem!



Data validation: To 供給する it...

Create the database. Of course, the 指名する isn't 始める,決める in 石/投石する, but while "working the example", I called it FDB1LISTB_18c20. ("解放する/自由な Data Base, 名簿(に載せる)/表(にあげる) Boxes (etc) (指名する of webpage, too), yymdd, where m is 1-9, a-c for Jan-Sept, Oct-Dec) (Put all connected with it in a folder, also with that 指名する. "登録(する)d" the database.)

Create a (米)棚上げする/(英)提議する in it. (I'd 示唆する using the Design 見解(をとる) approach.) We will call the (米)棚上げする/(英)提議する "HSL". (For "Hogwart's School 名簿(に載せる)/表(にあげる)")

In it, 供給する the に引き続いて fields:

指名する/ Type/ Etc...

ID, integer, 自動車 value, 最初の/主要な 重要な
指名する, text[VARCHAR], length 30
House, text[VARCHAR], 3

Decide now: At 12/18, it seems the next thing must be decided NOW. (When I tried to change the 関連した setting later in the 過程, I was 封鎖するd. There should be a way around that, but I don't know what it is at the moment. Just Do It: "it" 存在 "decide now": Do you... and there are プロの/賛成のs and 反対/詐欺s... want to REQUIRE an 入ること/参加(者) in the "House" field at all times? If so, 始める,決める the field's "入ること/参加(者) 要求するd" 所有物/資産/財産 to True... now. But if you aren't sure you want to make it obligatory to make an 入ること/参加(者), don't do it.)

の近くに the (米)棚上げする/(英)提議する design 道具. There's no need to open the (米)棚上げする/(英)提議する.

Next, create a form. You might use the wizard, or the 代案/選択肢 method. But how appropriate it would be, Harry, for this one, to use the "wizard"... so we'll do that...

You only need a very basic form. No sub-form needed.含む all fields, use "data sheet" 協定. 始める,決める the form up "to 陳列する,発揮する all data". (Don't dis-許す any modification. I went with the default "style". Call it HSLwLookup for "Hogwart's School 名簿(に載せる)/表(にあげる) With Lookup". Selecting "修正する the form" as the way you wish to proceed, and "finish", i.e. 出口 the wizard.

権利-click on the "House" column 長,率いるing.

Choose "取って代わる with..." and choose ListBox. (It will not be 申し込む/申し出d if the field is already 始める,決める up as a ListBox, by the way.)

権利-click on "House" column 長,率いるing again.

Choose "Column..." (not "挿入する", or "削除する" or "Hide column"!), and the ListBox's 所有物/資産/財産 editor should open up.

Click on the "General" tab, and type the に引き続いて three letter codes into the "名簿(に載せる)/表(にあげる) 入ること/参加(者)s" field, thus:

rav... then type 転換/ enter to go to the next line in the box,
gry... then type 転換/ enter to go to the next line in the box,
huf... then type 転換/ enter to go to the next line in the box,
sly... and then 圧力(をかける) enter, to の近くに the ListEntries data 入ること/参加(者) box)

In the 名簿(に載せる)/表(にあげる) 入ること/参加(者)s box, you should see...

"rav";"gry";"huf";"sly"

(It seems that you can't 簡単に enter the values in this 判型; you have to put them in the box that opens when you click on the 負かす/撃墜する arrow of the "名簿(に載せる)/表(にあげる) 入ること/参加(者)s" box. You 転換/ enter to get new lines so that each value is on its own line.)

(There's no need to の近くに the window 陳列する,発揮するing our shiny new form... but this would be a good time to save what you've done so far.)

の近くに the dialog we were just using, the "所有物/資産/財産s: 名簿(に載せる)/表(にあげる) Box" dialog.

(A 詳細(に述べる): You could, of course, in this 事例/患者, 簡単に use "r","g","h" and "s" to 示す the different houses. Notice I did not 提案する "R" or "Rav".... Do you want to fool with the 転換 重要な? The data will be buried inside the database most of the time. If you want, say, "rav" 現在のd 異なって in 生産(高) from the database, you can tell the computer to do that. Keep what's in the datbase, the underlying data, simple.)

In "the real world" it is usually wise to have a "mis" (for "Miscellaneous", too. You'd be surprised how often somethning "impossible" turns out to be necessary. If your data, when up to date, shouldn't have any pupils in the "mis" house, you can do a search to check. I've done real school 名簿(に載せる)/表(にあげる)s in the real world. いつかs we had a new pupil, and we didn't know what house he/ she would be in a the time the 名簿(に載せる)/表(にあげる)s went to "圧力(をかける)" (This was in the olden days of 署名/調印する on paper. Poor 管理/経営, and not a 肉親,親類d start for the kid at the schoo... but the data 入ること/参加(者) team is not always the data 世代 team.)

名簿(に載せる)/表(にあげる) box created... Here's how to Use it!...

OpenOffice interface

Use the toolbar associated with the form to leave design 方式. The 支配者/ pencil/ 始める,決める-square button... circled in illustration above... takes you in and out of "design 方式". (The 道具 妨げる/法廷,弁護士業 may be floating, as above, or ドッキングする/減らす/ドックに入れるd. If the toolbar is "行方不明の", use "見解(をとる)/ Toolbars". The 権利 toolbar's 肩書を与える says "Form 支配(する)/統制するs".)

When you've left the form design 方式, you should find a 列/漕ぐ/騒動 of "boxes" showing under the headers we just 明示するd. The first one will have "<AutoField>" in it, although you may only see part of that. Are we on the same page? If so... onward...

You should now be able to enter a 指名する in the "指名する" field of the first 記録,記録的な/記録する of the HSL (米)棚上げする/(英)提議する. (Click in the field's box, type... or use the tab 重要な and/or arrow 重要なs to move around the form.)

You can't enter anything in the first field, because we said it should be filled for us by the database... and it will be, as soon as we enter data someplace else for the 記録,記録的な/記録する 関心d.)

Moving into the "House" field will give rise to a downward pointing arrow, ("v") at the 権利 手渡す end of the field. Clicking on that opens up the ListBox, with rav, gry, huf and sly as your choices. Click on one to make it the value for that field for that 記録,記録的な/記録する.

Alternatively, once you are in the "House" field's 独房 on the grid, you can just type one of the valid 入ること/参加(者)s. (Base will even try to help you, in a manner 類似の to predictive text.)

You should find that you can't... with the form... enter anything other than "rav","gry","huf" or "sly". (If the field hasn't been 始める,決める up as one for which you must enter some data, you can leave the field blank, if you don't enter it, just go on, enter a その上の 記録,記録的な/記録する. But you can't enter anything other than "rav","gry","huf" or "sly". And once something is entered, you can't go 支援する to nothing.)

Base's is cleverness, that little bit 類似の to predictive texting 作品 like this: If you had houses axy, bxy, caa, cab, and ccc, then if you typed "a", you would get house axy. Type b and you get house bxy, but type c, and you'll get one of the "c" houses. Type cc, and you'll get ccc (the only one starting cc). Type ca, and you'll get one of caa and cab. Type the final letter (if necessary) to get the one you want. (Because it behaves this way, unless you have a strong 推論する/理由 for having codes with 株d first letters, I would choose abbreviations which 避ける that.)

A mystery... changing whether a value is 要求するd in a field

Open Office Base is a serious DBMS. As such it has さまざまな features to 支配(する)/統制する data 入ること/参加(者).

There is, for instance, a way to say that when a new 記録,記録的な/記録する is 存在 追加するd to the database, some or all of the fields must have data in them. (And if you are using 強制s, not only must there be data, but the datum 供給するd must be from a designer-決定するd 名簿(に載せる)/表(にあげる) of all possible answsers.

Building your database to work that way can have advantates... and it can be a nuisance.

Unfortunately, turning "要求する 入ること/参加(者)" on and off seems to be a little tricky.

First of all: You should do it by editing the 所有物/資産/財産s of the (米)棚上げする/(英)提議する. There is a "Input 要求するd" 所有物/資産/財産 on the data tab when, in Form Edit, you call up the 名簿(に載せる)/表(にあげる) Boxs's 所有物/資産/財産s. But changing that, there, doesn't seem to do what I would 推定する/予想する.

If you 明示する "data 要求するd" 権利 at the 手始め, when you are setting up the (米)棚上げする/(英)提議する, things seem to work okay.

It may even be 安全な... it worked in one minor 実験(する)... to turn OFF "要求する 入ること/参加(者)", as long as you do it at the level of the (米)棚上げする/(英)提議する.

Turning it on, either for the first time, or to return to a previous 明言する/公表する, seems to be more difficult... if not even いつかs impossible. Be 警告するd!

"The secret" may be as follows. You can (perhaps) switch "要求する 入ること/参加(者)" 支援する on, if, at the 現在の time, every 記録,記録的な/記録する has a (valid) 入ること/参加(者) in the field in question. (論理(学)の, when you think about it.)

----------------------------------------------------

Dropped down ListBox

Besides doing things with the mouse, you can also open (減少(する) 負かす/撃墜する) a ListBox with Alt-DownArrow. Once the 名簿(に載せる)/表(にあげる) has been opened, you can go up and 負かす/撃墜する it with the arrow 重要なs. 圧力(をかける) enter when you have the 権利 house selected. (My thanks to RGB for 令状ing in with that useful tip.)

Use "入ること/参加(者) 要求する"? Or not. And 関係のある 問題/発行するs.

罰金... you know a bit about what you can and cannot do.

Now let's think about what it is wise to want to do.

I am not a fan of making entering data for fields obligatory.

Take the 事例/患者 of the house field for the school 名簿(に載せる)/表(にあげる). It may be that someone is trying to get the 指名するs of some new pupils entered into the system before their houses have been 決定するd. (Certainly at Hogwart's this would be necessary, given the way houses are 割り当てるd there!) Even if you do know everyone's house in time, you may prefer to do your data 入ること/参加(者) by going 負かす/撃墜する the (米)棚上げする/(英)提議する, filling in the 指名するs, and then go 支援する through the data 割り当てるing houses in a second pass through the data. Neither approach is possible if you've made 入ること/参加(者) 要求するd for the house field.

By all means 制限する the values which can go into a field! This essay was written to help you do that. But often you need to 許す 使用者s to leave it empty, even if they are doing so only 一時的に. It is 平易な enough to 始める,決める up a query to 名簿(に載せる)/表(にあげる) all 記録,記録的な/記録するs with no value in a given field. Continuing the school 名簿(に載せる)/表(にあげる) example, the data 入ること/参加(者) people could enter things as they became 利用できる. Just before they printed any 報告(する)/憶測 which needed a value in the house field, they could run the query to be sure everyone had been 割り当てるd to a house.

In a 関係のある vein: Many times you will have something that can be true or 誤った. It may 支払う/賃金 you to 追加する a "Don't know" 選択. (I code such fields "t"/"f"/"?" to save typing.) Again, consider the school 名簿(に載せる)/表(にあげる): Suppose you want to know if the child lives with his or her 生物学の parents. (Not やむを得ず the school's 商売/仕事, and dangerous to gather on a 名簿(に載せる)/表(にあげる)... but it makes a good example of the sort of data that goes in the sort of field I want to discuss.) If you 制限する that field to "true" or "誤った", then what do you do when you don't know the child's circumstances? If you leave the field blank in such 事例/患者s, how do you distinguish....
a) the 記録,記録的な/記録するs that are blank because you don't know
....from....
b) the 記録,記録的な/記録するs that are blank because you've forgotten to enter the data?

底(に届く) line: "Don't know" can be a useful 選択. If you have a "Don't know", the blank fields are the ones you've forgotten to fill. As discussed 以前, when it is appropriate, you can 始める,決める up the (米)棚上げする/(英)提議する to 軍隊 you to enter something in every 記録,記録的な/記録する.

In other circumstances, "Misc" is a 価値のある 選択. If, using "Misc", you find that your database has 蓄積するd too many "Misc" 記録,記録的な/記録するs, you can look at them and define new 部類s to take some 記録,記録的な/記録するs out of the "Misc" 部類.



Data validation: An 代案/選択肢 道具: the ComboBox

ListBoxes will not let you enter something that isn't 供給するd for in the ListEntries 所有物/資産/財産. The ListEntries 名簿(に載せる)/表(にあげる) cannot be "汚染するd", as would be possible if you use a ComboBox 支配(する)/統制する. (See below). (However, if you use a ComboBox, you have other 道具s to 妨げる 無効の 入ること/参加(者)s... use a 強制. (See even その上の below).

The "ComboBox"... 類似の to ListBox.

Put the form 支援する into design 方式.

First I'll tell you what to do. In a moment I'll explain what you've done.

Change the House field to a ComboBox type field. All you need to do is 権利-click on the "House" field, choose "取って代わる with...", and click on "ComboBox". (The "built in" values we 設立するd earlier for the box's 名簿(に載せる)/表(にあげる) 入ること/参加(者)s will 固執する.)

Why?

I've asked you to do this to show you a の近くに cousin of the ListBox. A ComboBox is like a ListBox... you get the pull-負かす/撃墜する as before. However, with a ComboBox, you can also enter things by 手渡す. Now, in the Hogwart's example this wouldn't 普通は be necessary- all of the valid 入ること/参加(者)s are 供給するd for, Indeed, you could argue that a ListBox is better, because it 妨げるs a 使用者 from entering an 無効の value.

本人自身で, I 港/避難所't yet come to love the ComboBox. For one thing, it "蓄積するs" the things 使用者s enter. 粛清するing bad stuff can be done, but it is a 苦痛.

If, however, the fact that the ComboBox lets you enter anything in the field is important to you, there's still a way to have data validation...



Using 強制s to 保護する the data in a field from 無効の 入ること/参加(者)s

I had a long section here about. I think that 追加するing 強制 to (米)棚上げする/(英)提議するs is a good idea... more important that the tricks you've learned about so far, in fact.

I have a separate page for you, all about using 強制s to 保護する the data in a field from 無効の 入ること/参加(者)s.

====

I was in the final 行う/開催する/段階s of 実験(する)ing using ComboBoxes when I discovered a major 苦痛: If you enter a 以前 未使用の value into the ComboBox, even if you have a 強制 in place, that 無効の value becomes an 選択 in the pulldown 名簿(に載せる)/表(にあげる) of the ComboBox. Again... help from others on how to 妨げる this nuisance would be welcomed. (To save you trying what I did in desperation: Making the ComboBox read-only does what you'd 推定する/予想する, rather than what I hoped it might: It makes it impossible to change the field's value in a 記録,記録的な/記録する. Of course 存在 able to do what it does is 価値のある.... but there must be something else you can do to "lock" the 名簿(に載せる)/表(にあげる) of 選択s 現在のd by the ListBox part of the ComboBox?)

Here's the link to my eddress one more time, to make helping everyone 平易な for you!



編集(者)の Philosophy

I dislike 'fancy' websites with more 関心 for a flashy 外見 than for good content. For a pretty picture, I can go to an art gallery. Of course, an attractive 場所/位置 WITH content deserves 賞賛する... as long as that pretty 直面する doesn't cost download time. In any 事例/患者....

I am trying to 現在の this 構成要素 in a 判型 which makes it 平易な for you to USE it. There are two 面s to that: The way it is 分裂(する) up, and the way it is 地位,任命するd. See the main 索引 to this 構成要素 for more (警察などへの)密告,告訴(状) about the way it is 分裂(する) up, and the way it is 地位,任命するd.


広告 from page's editor: Yes.. I do enjoy 収集するing these things for you... I hope they are helpful. However.. this doesn't 支払う/賃金 my 法案s!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and 循環させる it for me? Links on your page to this page would also be 高く評価する/(相場などが)上がるd!

PLEASE >>> Click here to visit editor's Sheepdog ソフトウェア (tm) freeware, shareware pages <<< PLEASE


If you liked this ooBase tutorial, see the main 索引 for (警察などへの)密告,告訴(状) other help from the same author.

Editor's email 演説(する)/住所. Suggestions welcomed!     - - -    Want a 場所/位置 hosted, or email? I like 1&1's services.



Valid HTML 4.01 Transitional Page 実験(する)d for 同意/服従 with INDUSTRY (not MS-only) 基準s, using the 解放する/自由な, 公然と accessible validator at validator.w3.orgMostly passes. There were two "unknown せいにするs" in Google+ button code. Sigh.


One last bit of advice: Be sure you know all you need to about spyware.

. . . . . P a g e . . . E n d s . . . . .