G
Guest
I'm making changes to a program that contains the following comment and code:
Dim ctlActive As Control
' Temporary kludge until all print controls can receive focus (txtPrint
label control
' cannot receive the focus, therefore the last field user enters data
into does not
' otherwise get updated.)
Set ctlActive = ActiveControl
cmdEmail.SetFocus
ctlActive.SetFocus
This is at the top of an OnClick event (attached to a label) that is later
going to do:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
My question is the code at the top really needed? Is there some other way to
ensure that all fields updated get saved?
Thanks.
Dim ctlActive As Control
' Temporary kludge until all print controls can receive focus (txtPrint
label control
' cannot receive the focus, therefore the last field user enters data
into does not
' otherwise get updated.)
Set ctlActive = ActiveControl
cmdEmail.SetFocus
ctlActive.SetFocus
This is at the top of an OnClick event (attached to a label) that is later
going to do:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
My question is the code at the top really needed? Is there some other way to
ensure that all fields updated get saved?
Thanks.