Capation property of Form and Report

F

Frank Situmorang

Hello,

In my denomination church database I plan to have it used by all churces of
many countries. So I need to make it available in bilingual languages (
english and local language). I will start to make it English and Indonesian.

What I have in mind, that the name of the church for example, consists of 2
fields one for English and one for Indonesian.

My question is how can we make the caption property can take data(name of
the dhruch) from these fields. We will have a option which default is in
English and option is in local languange.

Thanks for any idea.
 
T

Tom van Stiphout

On Thu, 16 Oct 2008 01:04:31 -0700, Frank Situmorang

I wouldn't do two fields, but something more flexible:
tblLanguages
LanguageID
LanguageName

tblPhrases
PhraseID
PhraseName

tblPhrasesInLanguages
PhraseID
LanguageID
Phrase

Then you can write a simple query that can pull the correct phrase
based on the chosen language, and (for example) set the form title in
the form's Load event:
Me.Caption = GetPhrase(FORM1_CAPTION)

public function GetPhrase(byval intPhraseID as Integer) as String
'TODO: select the data, based on given PhraseID and global language
selection
GetPhraseID = strPhrase
end function

-Tom.
Microsoft Access MVP
 
F

Frank Situmorang

Hello Tom,

I am really surprised to know this capability of access, but since I am not
an advanced user, even my specialty in fact is an accountant, I appreciate if
you could educate me more on the following:

1. Suppose I want to to setup the database for Indonesian languange, when
shall be prompted to fill in the language.

2. What is the diferent of the following tables and their funcktions
a. tblLanguages
b. tblPhrases
c. tblPhrasesInLanguages

Do you have the sample of your database for these features?, so that I know
how to make it in the real world. I just can't imagine it

Thanks very much for your help.
 
F

Frank Situmorang

Hi Tom:

I am not so clear TOM, if the PhraseID is 1
Shall we say Me.Caption = GetPhrase1(FORM1_CAPTION)

Where shall we put it in the VBA

Thanks for your help.

Frank
 
T

Tom van Stiphout

On Thu, 16 Oct 2008 23:55:00 -0700, Frank Situmorang

1: Ahead of time. Before the first user uses the app in Production.
The way we did this for one client is that we had a webpage with the
English words and asked the Japanese distributor/user to enter the
Japanese corresponding phrases.

2: tblLanguages: a list of languages:
1 - Indonesian
2 - English
3 - Dutch

tblPhrases: a list of words or sentences that need translation
101 - This is the title for Form 1
102 - Some word
103 - Another word

tblPhrasesInLanguages: the actual translations
101 - 1 - <Sorry, my Indonesian is not very good>
101 - 2 - Welcome to form 1
101 - 3 - Welkom. Dit is form 1
102 - 1 - <firstname in Indonesian>
102 - 2 - First Name
102 - 3 - Voornaam
etc.

Then you create global constants representing the PhraseIDs:
global const FORM1_CAPTION = 101
global const FORM1_FIRSTNAME = 102
etc.

Then in Form1's Form_Load you call a central function you write:
Me.Caption = GetPhrase(FORM1_CAPTION)
GetPhrase would know which language had been chosen (a global
variable), and would then be able to pull the correct phrase given the
constant passed in.

If the above is totally unclear, it might be best to hire professional
assistance.

Regards,

-Tom.
Microsoft Access MVP
 
F

Frank Situmorang

Tom...Thank you very much. It is not totally unclear, your explanantion is
very helpful to me.

Since there will be many language, when we will be prompted to choose the
language when we have the languange on the table..

More specific to your explanantion about this:
global const FORM1_CAPTION = 101

Shouldn't it be this one, if we want to choose Indonesian Language:
global const FORM1_CAPTION = 101-1 ?.

I just want to check my understanding, please correct me if I am wrong.

Thanks very much for your help.
 
T

Tom van Stiphout

On Sun, 19 Oct 2008 23:23:03 -0700, Frank Situmorang

See comments in-line.
-Tom.
Tom...Thank you very much. It is not totally unclear, your explanantion is
very helpful to me.

Since there will be many language, when we will be prompted to choose the
language when we have the languange on the table..

More specific to your explanantion about this:
global const FORM1_CAPTION = 101
I used 101 because I had previously defined the phrases as:
101 - This is the title for Form 1
102 - Some word
103 - Another word
Shouldn't it be this one, if we want to choose Indonesian Language:
global const FORM1_CAPTION = 101-1 ?.
There is no minus in the sense of 101-1=100.
Rather I had previously defined:
tblPhrasesInLanguages
PhraseID
LanguageID
Phrase

So when I wrote:
101 - 1 - <Sorry, my Indonesian is not very good>

I meant to say:
PhraseID=101
LanguageID=1
 
T

Tom van Stiphout

On Fri, 17 Oct 2008 03:15:02 -0700, Frank Situmorang

I suggested a function named GetPhrase.
Since it needs to be able to be called from any form, it should be a
Public function in a standard module.

-Tom.
Microsoft Access MVP
 
F

Frank Situmorang

Thanks very much Tom for your explanation.

Let me tell you that I have finished desinghing my church denomination
membership database. I have many forms and reports

This is the tedious work that I do. For Kebayoran SDA church, I go to the
caption property of the forms and reports and the header label of the report
I put in the caption " Kebayoran SDA church"

Then if the database will be given to other churches such as "Salemba SDA
church", I changed the caption property from Kebayoran SDA church to Salemba
SDA church.

My quetion is does the approach you suggested can also be applied to the
name of the church like what I expereience above?.Or could be too many global
constants?

Thanks for your explanation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top