I have a button on form1 which opens form2 which is built on a separate table. I'm using variables to show the camid, first, mi and Last field values. When the form opens, all fields show values from from1.
When the record is saved, the value in the camid field fails to save, thus the link to the child record is broken. The values from the other 3 fields save and show in the now orphaned child record.
Here's my code. It was working great for quite some time. Any idea what's causing the camid value not to save on the child record?
if is_object("NCS")
NCS.new_record() 'begin new record
'Assign a value to that record
NCS:Camid.value = parentform:Camid.value
NCS:FirstName.value = parentform:FirstName.value
NCS:Mi.value = parentform:Mi.value
NCS:LastName.value = parentform:LastName.value
'Assign value to the local var on the called form (NCS)
NCS:VarCamid.value = parentform:Camid.value
NCS:VarFirst.value = parentform:FirstName.value
NCS:VarMi.value = parentform:Mi.value
NCS:VarLast.value = parentform:LastName.value
'Display the called form
NCS.show()
NCS.activate()
else
Form.load("NCS")
NCS.new_record()
'Assign value to that record
NCS:Camid.value = parentform:Camid.value
NCS:FirstName.value = parentform:FirstName.value
NCS:Mi.value = parentform:Mi.value
NCS:LastName.value = parentform:LastName.value
'assign value to the local var on the called form
NCS:VarCamid.value = parentform:Camid.value
NCS:VarFirst.value = parentform:FirstName.value
NCS:VarMi.value = parentform:Mi.value
NCS:VarLast.value = parentform:LastName.value
NCS.show() 'Display the called form
NCS.activate()
End If
END
Thanks,
kenn
When the record is saved, the value in the camid field fails to save, thus the link to the child record is broken. The values from the other 3 fields save and show in the now orphaned child record.
Here's my code. It was working great for quite some time. Any idea what's causing the camid value not to save on the child record?
if is_object("NCS")
NCS.new_record() 'begin new record
'Assign a value to that record
NCS:Camid.value = parentform:Camid.value
NCS:FirstName.value = parentform:FirstName.value
NCS:Mi.value = parentform:Mi.value
NCS:LastName.value = parentform:LastName.value
'Assign value to the local var on the called form (NCS)
NCS:VarCamid.value = parentform:Camid.value
NCS:VarFirst.value = parentform:FirstName.value
NCS:VarMi.value = parentform:Mi.value
NCS:VarLast.value = parentform:LastName.value
'Display the called form
NCS.show()
NCS.activate()
else
Form.load("NCS")
NCS.new_record()
'Assign value to that record
NCS:Camid.value = parentform:Camid.value
NCS:FirstName.value = parentform:FirstName.value
NCS:Mi.value = parentform:Mi.value
NCS:LastName.value = parentform:LastName.value
'assign value to the local var on the called form
NCS:VarCamid.value = parentform:Camid.value
NCS:VarFirst.value = parentform:FirstName.value
NCS:VarMi.value = parentform:Mi.value
NCS:VarLast.value = parentform:LastName.value
NCS.show() 'Display the called form
NCS.activate()
End If
END
Thanks,
kenn
Comment