Hi:
I am trying to automate the creation of a new child record in a sports registration database. The prime table (core details) is linked to a table (signed) on a "one to many" basis. Each year all active entries in the signed table are deactivated and those who apply for new registration in the following year then have to be re-activated. There are 5 fields in the signed table which need to be dragged forward into the new record when created. To simplify matters I am trying to create a button within a sub form of the main data entry form to automatically create the new record.
I have tried to use the action scripting which I have then converted to xbasic. When I press the button I get an error message "no such field". I do not know what I am doing wrong but if anyone can help it would be appreciated!
The created script is copied below, I think it makes sense?
Team_Signed is the sub form. I have created 5 layout variables "v_teamcode:N" etc
---------------------------
Team_Signed.fetch_first()
v_teamcode:N = TEAM_CODE.VALUE
v_teamfull:C = TEAMFULL.VALUE
v_status:C = STATUS.VALUE
v_bafca_code:C = BAFCA_CODE.VALUE
v_issuedate:D = ISSUEDATE.VALUE
Team_Signed.new_record()
DATE_JOINED.VALUE = System->Date
TEAM_CODE.VALUE = Var->v_Teamcode
TEAMFULL.VALUE = Var->v_teamfull
STATUS.VALUE = Var->v_status
CARDISSUED.VALUE = .t.
ISSUEDATE.VALUE = Var->v_Issuedate
BUTTON2.Activate()
---------------------------
I am trying to automate the creation of a new child record in a sports registration database. The prime table (core details) is linked to a table (signed) on a "one to many" basis. Each year all active entries in the signed table are deactivated and those who apply for new registration in the following year then have to be re-activated. There are 5 fields in the signed table which need to be dragged forward into the new record when created. To simplify matters I am trying to create a button within a sub form of the main data entry form to automatically create the new record.
I have tried to use the action scripting which I have then converted to xbasic. When I press the button I get an error message "no such field". I do not know what I am doing wrong but if anyone can help it would be appreciated!
The created script is copied below, I think it makes sense?
Team_Signed is the sub form. I have created 5 layout variables "v_teamcode:N" etc
---------------------------
Team_Signed.fetch_first()
v_teamcode:N = TEAM_CODE.VALUE
v_teamfull:C = TEAMFULL.VALUE
v_status:C = STATUS.VALUE
v_bafca_code:C = BAFCA_CODE.VALUE
v_issuedate:D = ISSUEDATE.VALUE
Team_Signed.new_record()
DATE_JOINED.VALUE = System->Date
TEAM_CODE.VALUE = Var->v_Teamcode
TEAMFULL.VALUE = Var->v_teamfull
STATUS.VALUE = Var->v_status
CARDISSUED.VALUE = .t.
ISSUEDATE.VALUE = Var->v_Issuedate
BUTTON2.Activate()
---------------------------
Comment