?
=?windows-1250?Q?Vladim=EDr_Cvajniga?=
In PC FAND (long time ago) we had table declarations as follows:
File (table) declaration:
1) stored fields
2) key declaration section #K
3) calculated fields section #C
Key declaration and calculated fields sections could be declared more than
once.
-------------------------------------------------
lookup table LookSU (superior table):
SU: A,3; (dbText, 3)
SUname: A,30; (dbText, 30)
Vrozp: B; (dbBoolean)
#K @ SU; (unique primary key)
-------------------------------------------------
data table Data (subordinate table):
dDate: D; (dbDate)
SU: A,3; (dbText, 3)
#K @ *Date; (non-unique primary key)
SU (@) *SU; (secondary non-unique key)
DateSU (@) *dDate;SU; (secondary non-unique key)
LookSU ! SU; (foreign key with referential integrity)
(or LookSU SU - without referential integrity)
#C SUname:=LookSU.SUname: A,30;
Vrozp:=LookSU.Vrozp: B
-------------------------------------------------
Edit form could contain both stored and calculated fields, eg.:
EditData
#_Data (based on table Data)
dDate, SU, SUname, VRozp;
__.__.____ ___ ______________________________ _ (edit masks)
-------------------------------------------------
In forms it was possible to edit ONLY table's stored field, ie. it was
impossible to change data in foreign tables (except foreign key fields in
subordinate tables with referential integrity - it was done automatically
like in MS Access).
All "foreign" values (calculated fields based on superior tables) were
available immediatelly after user's input of foreign-key-field value. If
user deleted a record in data table no other records in superior tables were
affected, ie. those records could not be deleted from an edit form as shown
above.
New record was edited sequentially (field by field, from "left to right"),
ie. it was impossible to skip an unedited field.
===========================
In MS Access I have:
lookup table LookSU (superior table):
SU dbText, 3
SUname dbText, 30
Vrozp dbBoolean
unique primary key SU
-------------------------------------------------
data table Data (subordinate table):
dDate dbDate
SU dbText, 3
non-unique key dDate (dDate)
non-unique key dDateSU (dDate, SU)
non-unique key SU
-------------------------------------------------
query qryData (RecordsetType = 1):
SELECT Data.*, LookSU.SUname, LookSU.Vrozp
FROM Data INNER JOIN LookSU ON Data.SU = LookSU.SU;
-------------------------------------------------
a form based on qryData with these fields:
dDate TextBox
SU ComboBox
SUname TextBox
VRozp CheckBox (invisible)
-------------------------------------------------
What I need in a form:
1) LookSU.Vrozp value immediatelly after Data.SU input. I need this value
for logical controls (validations) in SU_BeforeUpdate event procedure.
2) Leave LookSU table untouched when I delete a record in Data (bear in mind
possible multiple record selection).
3) Display SUname without using a combo-box based on Data.SU.
4) Display SUname immediatelly after SU input.
Is anything possible in MS Access without DLookup in calculated fields?
What I'd like in a form:
5) Sequencial input (from "left to right") similar to PC FAND... ;-)
Thank you very much in advance.
Vlado
P.S. This example shows only a small part of what I need to do. In my
project (my particular form) there are six "calculated" fields based on
foreign keys. I would like to avoid DLookups to speed the form up.
P.P.S. Excuse me for my poor English. I hope you've got what I've tried to
explain.
File (table) declaration:
1) stored fields
2) key declaration section #K
3) calculated fields section #C
Key declaration and calculated fields sections could be declared more than
once.
-------------------------------------------------
lookup table LookSU (superior table):
SU: A,3; (dbText, 3)
SUname: A,30; (dbText, 30)
Vrozp: B; (dbBoolean)
#K @ SU; (unique primary key)
-------------------------------------------------
data table Data (subordinate table):
dDate: D; (dbDate)
SU: A,3; (dbText, 3)
#K @ *Date; (non-unique primary key)
SU (@) *SU; (secondary non-unique key)
DateSU (@) *dDate;SU; (secondary non-unique key)
LookSU ! SU; (foreign key with referential integrity)
(or LookSU SU - without referential integrity)
#C SUname:=LookSU.SUname: A,30;
Vrozp:=LookSU.Vrozp: B
-------------------------------------------------
Edit form could contain both stored and calculated fields, eg.:
EditData
#_Data (based on table Data)
dDate, SU, SUname, VRozp;
__.__.____ ___ ______________________________ _ (edit masks)
-------------------------------------------------
In forms it was possible to edit ONLY table's stored field, ie. it was
impossible to change data in foreign tables (except foreign key fields in
subordinate tables with referential integrity - it was done automatically
like in MS Access).
All "foreign" values (calculated fields based on superior tables) were
available immediatelly after user's input of foreign-key-field value. If
user deleted a record in data table no other records in superior tables were
affected, ie. those records could not be deleted from an edit form as shown
above.
New record was edited sequentially (field by field, from "left to right"),
ie. it was impossible to skip an unedited field.
===========================
In MS Access I have:
lookup table LookSU (superior table):
SU dbText, 3
SUname dbText, 30
Vrozp dbBoolean
unique primary key SU
-------------------------------------------------
data table Data (subordinate table):
dDate dbDate
SU dbText, 3
non-unique key dDate (dDate)
non-unique key dDateSU (dDate, SU)
non-unique key SU
-------------------------------------------------
query qryData (RecordsetType = 1):
SELECT Data.*, LookSU.SUname, LookSU.Vrozp
FROM Data INNER JOIN LookSU ON Data.SU = LookSU.SU;
-------------------------------------------------
a form based on qryData with these fields:
dDate TextBox
SU ComboBox
SUname TextBox
VRozp CheckBox (invisible)
-------------------------------------------------
What I need in a form:
1) LookSU.Vrozp value immediatelly after Data.SU input. I need this value
for logical controls (validations) in SU_BeforeUpdate event procedure.
2) Leave LookSU table untouched when I delete a record in Data (bear in mind
possible multiple record selection).
3) Display SUname without using a combo-box based on Data.SU.
4) Display SUname immediatelly after SU input.
Is anything possible in MS Access without DLookup in calculated fields?
What I'd like in a form:
5) Sequencial input (from "left to right") similar to PC FAND... ;-)
Thank you very much in advance.
Vlado
P.S. This example shows only a small part of what I need to do. In my
project (my particular form) there are six "calculated" fields based on
foreign keys. I would like to avoid DLookups to speed the form up.
P.P.S. Excuse me for my poor English. I hope you've got what I've tried to
explain.