K
Kevin Sprinkel
Thanks to a recent posting, I've been able to avoid
the "disappearing data" that occurs when the Row Source of
a combo box is set based on the value of another control
on a continuous subform.
The following code works--when the focus passes to the
textbox, a second form opens, displaying appropriate rows
in a combo box. After selection, this value and two other
columns are copied back to the subform.
Once the value has been selected in the combo box, I would
like to move the cursor to the next field in the subform,
which has a GotFocus event attached to it. Apparently
moving to the control explicitly prevents the event from
firing.
Does anyone know how I can explicitly trigger it, or have
another solution?
Thanks for all help.
Kevin Sprinkel
Private Sub txtSteelSize_GotFocus()
' Textbox in subform that holds data selected by the
' combo box.
On Error Resume Next
DoCmd.OpenForm _
FormName:="frmSelectSteelSize", _
View:=acNormal, _
WindowMode:=acDialog
End Sub
Private Sub cboSteelSize_AfterUpdate()
' Combo box on popup form
' Formatting altered for readability
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!
txtSteelSizeID = Me!cboSteelSize
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!txtLBperLF =
Me!cboSteelSize.Column(3)
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!txtSFperLF =
Me!cboSteelSize.Column(4)
Forms!frmSteelTakeoff!sbfSteelTakeoff.SetFocus
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!
txtResult.SetFocus
DoCmd.Close
End Sub
the "disappearing data" that occurs when the Row Source of
a combo box is set based on the value of another control
on a continuous subform.
The following code works--when the focus passes to the
textbox, a second form opens, displaying appropriate rows
in a combo box. After selection, this value and two other
columns are copied back to the subform.
Once the value has been selected in the combo box, I would
like to move the cursor to the next field in the subform,
which has a GotFocus event attached to it. Apparently
moving to the control explicitly prevents the event from
firing.
Does anyone know how I can explicitly trigger it, or have
another solution?
Thanks for all help.
Kevin Sprinkel
Private Sub txtSteelSize_GotFocus()
' Textbox in subform that holds data selected by the
' combo box.
On Error Resume Next
DoCmd.OpenForm _
FormName:="frmSelectSteelSize", _
View:=acNormal, _
WindowMode:=acDialog
End Sub
Private Sub cboSteelSize_AfterUpdate()
' Combo box on popup form
' Formatting altered for readability
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!
txtSteelSizeID = Me!cboSteelSize
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!txtLBperLF =
Me!cboSteelSize.Column(3)
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!txtSFperLF =
Me!cboSteelSize.Column(4)
Forms!frmSteelTakeoff!sbfSteelTakeoff.SetFocus
Forms!frmSteelTakeoff!sbfSteelTakeoff.Form!
txtResult.SetFocus
DoCmd.Close
End Sub