Access Datasheet Default Value

  • Thread starter Thread starter Rick L.
  • Start date Start date
R

Rick L.

I have a Database form where the datafield is a combo box. I would like to
have the default value of the next record be based on the previous record in
the Datasheet.
Is this possible, and if so how?
thanks
 
In the AfterUpdate event of the combo box, set its DefaultValue to the
current value:

Private Sub Combo1_AfterUpdate()
Me!Combo1.DefaultValue = Chr$(34) & Me!Combo1 & Chr$(34)
End Sub

The Chr$(34) before and after Me!Combo1 are to put quotes around the value.
Regardless of what the actual data type of the value in the combo box may
be, the DefaultValue property is text.
 
Back
Top