Vous êtes sur la page 1sur 9

Microsoft Access

TM












admin@mistirios.net


Page 2 from 9

DesignNotes
This sample database demonstrates contact keeping in various languages (the interface is
always in english but stored contact data can be multilingual)

Main form
As a base for db schema and interface design, Microsofts contacts template has been
used. From the Contacts table, all fields that can store data in more than one language
have been transferred to new tables. Fields as telephones, email address, etc. that are
unique - in the multilingual context - have been kept intact.



Design Notes Page 3 from 9

D
e
s
i
g
n

N
o
t
e
s



9


D
e
s
k
t
o
p

C
o
n
t
a
c
t
s

M
u
l
t
i
-
L
i
n
g
u
a
l

D
e
m
o


Relationships


Design Notes Page 4 from 9

D
e
s
i
g
n

N
o
t
e
s



9


D
e
s
k
t
o
p

C
o
n
t
a
c
t
s

M
u
l
t
i
-
L
i
n
g
u
a
l

D
e
m
o


First of all a new table (tbl_Languages) for languages definition has been created along
with a check box to define the current language for names display and respective reports.
Each new table that contains the same field data in different languages must have a key
language number for reference.
Par example the fields First Name and Last Name are in the table
tbl_Contact_Names_Per_Language:

Field Name Type Description
ID Autonumber The tables key
Last Name Text Contacts last name
First Name Text Contacts first name
Language Number Language key
PersRefID Number Contact key

The same design goes for tables tbl_Addressses_Per_Language (obvious use) and
tbl_Other_Contact_Info_Per_Language (sex, married, nationality, etc.)

The Contact List form

Contact List Form
displays contact information in Split View using the Contacts Extended query to display
First Name and Last Name in the current language.


Design Notes Page 5 from 9

D
e
s
i
g
n

N
o
t
e
s



9


D
e
s
k
t
o
p

C
o
n
t
a
c
t
s

M
u
l
t
i
-
L
i
n
g
u
a
l

D
e
m
o


Contacts Extended Query in Design View
When the user opens a contact the Contact Details form is opened

Contact Details Form
where subforms for each table that handles multilingual data are placed inside.



Design Notes Page 6 from 9

D
e
s
i
g
n

N
o
t
e
s



9


D
e
s
k
t
o
p

C
o
n
t
a
c
t
s

M
u
l
t
i
-
L
i
n
g
u
a
l

D
e
m
o

A form Languages (Datasheet View) in form Parameters handles the languages entries
and current language definition.

Parameters > Languages
The trick here is that only one language can be selected as current, so some VBA is in
order for the check boxs Before and AfterUpdate Events:

Private Sub Default_AfterUpdate()

Me.Default = -1
Me.Requery

If CurrentProject.AllForms("Contact List").IsLoaded = True Then
Forms![Contact List].Requery
Forms![Contact List]!cboReports.Requery
End If


Design Notes Page 7 from 9

D
e
s
i
g
n

N
o
t
e
s



9


D
e
s
k
t
o
p

C
o
n
t
a
c
t
s

M
u
l
t
i
-
L
i
n
g
u
a
l

D
e
m
o


End Sub

The if statement checks whether the form Contact List is loaded and if it is, a form and a
combo (cboReports) requery is performed.

Private Sub Default_BeforeUpdate(Cancel As Integer)

If Me.NewRecord Then Cancel = True: Me.Undo
If Not Me.Default Then Exit Sub

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE [tbl_languages] SET [Default]=0"
DoCmd.SetWarnings True

End Sub

A critical design step to achieve multilingual reports is to define structures, meaning the
type of report we want depending on the use. For this demo the only type defined is the
Contact Phone List as a use case. A new table Reports by Structure stores which report
refers to which language. For each language a different report must be designed - but for
more languages only the labels from the original design must be altered.



Design Notes Page 8 from 9

D
e
s
i
g
n

N
o
t
e
s



9


D
e
s
k
t
o
p

C
o
n
t
a
c
t
s

M
u
l
t
i
-
L
i
n
g
u
a
l

D
e
m
o


Parameters > Reports by Language
Par example, if English is defined as the current language, then in Contact List the only
available report will be in English (if defined in Reports by Language form in Parameters)

Contact List and Report in English only


Design Notes Page 9 from 9

D
e
s
i
g
n

N
o
t
e
s



9


D
e
s
k
t
o
p

C
o
n
t
a
c
t
s

M
u
l
t
i
-
L
i
n
g
u
a
l

D
e
m
o



Contact Phone List Report (English)

Vous aimerez peut-être aussi