Can drop-down lists on forms default to the last item selected?

  • Thread starter Thread starter Stephen Glynn
  • Start date Start date
S

Stephen Glynn

Is it possible to have drop-down lists recall the last item selected;
e.g. if I've just entered an order for widgets, can I be offered widgets
as the default choice for the next order I enter (assuming I've not
meanwhile closed the form, of course)?

Similarly, if I've just entered a date field manually on a form, is it
possible to get the form to offer me that date for the next data entry
if the form has remained open?

Steve
 
Stephen

One way to do what you described is to set code in the control's AfterUpdate
event that modifies the DefaultValue. Check Access HELP on these two
topics.

Good luck

Jeff Boyce
<Access MVP>
 
Stephen,

I have used a similar process but what I do is based on the current record.
On an event, I create a new record and then copy the fields from the current
to the new. That way you can either do the last record or any existing
record to a new one. The following shows Item and Activity being copied to a
new record on the On Click of a button:

Dim NewItem As String
Dim NewAct As String

NewItem = Me.Item
NewAct = Me.Activity

DoCmd.GoToRecord , , acNewRec
[Item] = NewItem
[Activity] = NewAct

Hope this helps.
 
Back
Top