| Subject |
Re: creating unique key : usingprimair key and foreign key |
| From |
Dirk <dirk.cardoen1@gmail.com> |
| Date |
Wed, 3 Feb 2021 20:37:00 +0100 |
| Newsgroups |
dbase.getting-started |
Hello, thanks for your reply
short explain;
parent = articles query : here i link with own increment system ( using
already years on a cusomer query , no problems
child = cross references linked with parent on a normal way
( Ken, bought your hardcore years ago and last year your pdf books,
hardcore today i use to read a bit in bed :) )
my problem was to create a second key to the child query (cross
references) first i used the same way to create a prim.key like on
parent, so struggling a bit and last night was thinking to create a
second query on cross references, what has been done ( i know thier are
better solutions ) but for now ok everything is working on the way i want.
in fact when i creaet an article on the parent this info is stored in
the crossreference (child query)
in this way the child query becomes parent for other purpose
in the corssrefereces i can add other brand references for the same
products with all kind of marketing information to calculate prices
based on the market and make choice of suppliers..
the cross reference query foreign key will be primaire key
for additional information and picture by row line
you know it's like you go to the shop : the article you need is
exhausted, with a cross you sometime can help a customer
as Mervyn sometimes says: their are different ways to get a solution as
long it's work :)
thanks
and take care in this strange time
Dirk
Op 1/02/2021 om 14:55 schreef Dirk:
> Good day,
>
> to collect information about all kind of articles and product i use the
> following ( a main tabble and a child table)
>
> by query
> the main tabel get a unique nr and main information, this info putted
> aswell in the child table :
>
> the child table follows the main table as usual way..
>
> the child table get his own unique nr as done by : see below:
>
> because of using the indexname of the child query, i can not vome back
> to the main query, meaning the child query doesn't follow the main query
> anymore ..
>
> once using the child query thers is no probleme to add or modify the info
>
> but creating a new record i have to restart the programm
>
> the watch is the index
>
> does someone have a hint
>
> Thanks
>
> Dirk Cardoen,
>
>
>
>
> function KNOP_CROSSBIJVOEG_onClick()
> local crossK,crossOpslaan
> crossOpslaan =
> this.parent.parent.vraagbak_crossen.rowset.indexname
> this.parent.parent.vraagbak_crossen.rowset.indexname =
> "ivolgID"
> if this.parent.parent.vraagbak_crossen.rowset.endoFset
> crossK = "0000000001"
> else
> this.parent.parent.vraagbak_crossen.rowset.last()
> crossK=
> str(val(this.parent.parent.vraagbak_crossen.rowset.fields["eigenvolgnr"].value)+1,10,0,"0")
>
> endif
> this.parent.parent.vraagbak_crossen.Rowset.IndexName =
> crossOpslaan
> this.parent.parent.vraagbak_crossen.rowset.beginappend()
>
> this.parent.parent.vraagbak_crossen.rowset.fields["eigenvolgnr"].value
> =crossK
>
> this.parent.parent.vraagbak_crossen.rowset.fields["crossingavedatum"].value
> = date()
>
> this.parent.parent.vraagbak_crossen.rowset.fields["crossvolgnr"].value =
> this.form.rowset.fields["volgnr"].value
> form.keuzedoos_crossfirma.datalink =
> this.parent.parent.vraagbak_crossen.rowset.fields["crossleverancierId"]
> form.keuzedoos_crossmerk.datalink =
> this.parent.parent.vraagbak_crossen.rowset.fields["crossbrandnr"]
> form.keuzedoos_crossprod.datalink =
> this.parent.parent.vraagbak_crossen.rowset.fields["crossproductnr"]
> form.keuzedoos_crosseenheid.datalink =
> this.parent.parent.vraagbak_crossen.rowset.fields["crosseenheid"]
> class::crosskleuren(null)
> return
> *****
|
|