AlastairOz
Technical User
I have a parent table called "Sites"
I have a child table called "AssetLights"
I have both on a form with a relationship set.
I select a record from the parent "sites" using a control.
Then when adding a new record to child "assetslights",
I want to copy the value of the ID field from the parent to the child.
There is a relationship set between the 2 tables.
I am new to this, so any help would be appreciated.
This is what I have so far, now I am stuck:
LOCAL tParentRec
SELECT sites
tParentRec = IIF(EOF(), -1, RECNO())
COUNT
IF tParentRec > 0
GOTO (tParent)
ENDIF
** I think this gets the current record number of the
** table sites
I have a child table called "AssetLights"
I have both on a form with a relationship set.
I select a record from the parent "sites" using a control.
Then when adding a new record to child "assetslights",
I want to copy the value of the ID field from the parent to the child.
There is a relationship set between the 2 tables.
I am new to this, so any help would be appreciated.
This is what I have so far, now I am stuck:
LOCAL tParentRec
SELECT sites
tParentRec = IIF(EOF(), -1, RECNO())
COUNT
IF tParentRec > 0
GOTO (tParent)
ENDIF
** I think this gets the current record number of the
** table sites