carry a value

  • Thread starter Thread starter Guest
  • Start date Start date
You could store the value in a local variable in the form. Then make a
public function that returns the variable and set the default value of the
text box equal to the function.

For instance in your form:

Private mlngEmployeeID as Long

Private Sub Form_Load
mlngEmployeeID = Clng(Me.EmployeeID.Value)
End Sub

Public Function CurrentEmployeeID As Long
CurrentEmployeeID = mlngEmployeeID
End Function

In the controls default value property in the property inspector set
=CurrentEmployeeID()
 
I have accomplished this by putting an on update event on
the combo box that pushes a value to a hidden text box
that is in the header. You can then set the default value
on the combo box to to the me.txtboxhidden value. the
first time the record is entered the default value is
null, after that the value in the combo box will stay the
same until it is intentionally changed.

Hope that helps.

SDH
 
Back
Top