Access Datasheet Default Value

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
 
D

Douglas J. Steele

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top