R
Ron Kunce
I need to update a record from two different forms. One is a bound form
which calls an unbound form which can change other fields in the same record
of the calling bound form. My original solution was to write all the fields
from the unbound form to hidden fields on the bound form and is saved to the
table when the bound form is saved/closed. However, the unbound form has
been expanded to call a report which needs updated data before the bound
forms is saved. I have tried to use a recordset to update the record from
the unbound form, but this invokes a write error/warning stating that
another user has changed the record when returning to the calling bound
form. I have tried to have the unbound form write the data to the bound
found and tell to bound form to save itself, as in:
Forms!frmReferralUpdate.txtProbateFileDate = Me.txtProbateFileDate
Forms!frmReferralUpdate.txtProbateCloseCode = Me.txtProbateCloseCode
Forms!frmReferralUpdate.txtProbateCloseDate = Me.txtProbateCloseDate
Forms!frmReferralUpdate.txtReferralDate.SetFocus
Forms!frmReferralUpdate.SaveReferral
Me.txtDateOfDeath.SetFocus
However, this only works when stepping through the code in debug mode, while
running it normally fails to execute the call to bound forms SaveReferral
method. Inserting a timing delay loop does no good. I do not understand
why it steps through the code perfectly but won't run normally.
I figure the best way would be to rewrite the bound form as a unbound form
and use a class module to get and update the data, but that would be a lot
of re writing. the original bound form has too many fields and code and
would take a long time to do it right. Does anyone know of an easier
solution?
which calls an unbound form which can change other fields in the same record
of the calling bound form. My original solution was to write all the fields
from the unbound form to hidden fields on the bound form and is saved to the
table when the bound form is saved/closed. However, the unbound form has
been expanded to call a report which needs updated data before the bound
forms is saved. I have tried to use a recordset to update the record from
the unbound form, but this invokes a write error/warning stating that
another user has changed the record when returning to the calling bound
form. I have tried to have the unbound form write the data to the bound
found and tell to bound form to save itself, as in:
Forms!frmReferralUpdate.txtProbateFileDate = Me.txtProbateFileDate
Forms!frmReferralUpdate.txtProbateCloseCode = Me.txtProbateCloseCode
Forms!frmReferralUpdate.txtProbateCloseDate = Me.txtProbateCloseDate
Forms!frmReferralUpdate.txtReferralDate.SetFocus
Forms!frmReferralUpdate.SaveReferral
Me.txtDateOfDeath.SetFocus
However, this only works when stepping through the code in debug mode, while
running it normally fails to execute the call to bound forms SaveReferral
method. Inserting a timing delay loop does no good. I do not understand
why it steps through the code perfectly but won't run normally.
I figure the best way would be to rewrite the bound form as a unbound form
and use a class module to get and update the data, but that would be a lot
of re writing. the original bound form has too many fields and code and
would take a long time to do it right. Does anyone know of an easier
solution?