update default based on last entry

E

exoatcake

I know this question (below) has been answered before before but was hoping
someone could put it in idiots terms for me.


"I have a database where many of the entries (ie. date, model no.) repeat for
30+ records. How can I set up the form so that if I enter data in a
control, it will automatically set that value as the default. This way I
can just hit enter when I reach that control again if the date is the same."


Fred's question is exacty my question , the only difference being is I am a
access novice. have created some simple tables, queries and forms, but am
rather stuck on getting the last record to appear on the form.

Could somebody please take me through it step by step.

Any help would be much appreciated.

Thanks

Lee
 
O

Ofer

On the after update event of the form you can enter the code

Private Sub Form_AfterUpdate()
Me.Date1.DefaultValue = Me.Date1
Me.model .DefaultValue = Me.model
Me.FieldName.DefaultValue = Me.FieldName

End Sub
 
E

exoatcake

Doesnt seem to work

Ofer said:
On the after update event of the form you can enter the code

Private Sub Form_AfterUpdate()
Me.Date1.DefaultValue = Me.Date1
Me.model .DefaultValue = Me.model
Me.FieldName.DefaultValue = Me.FieldName

End Sub
 
O

Ofer

Put a code break in this sub to see if you enter this code.

If you copy and paste the code I gave you it's not enough, you need to open
the form properties and go to the on load event to see if it apears there.
I tried this code before I posted it and it worked
 
Top