Editing default value in form

G

Geoff

I have a form where I want the default value to be the same as the previous
record (which the user has the option to change). I know I can use the Dmax
function but the previous record won't necessarily have the highest number
in. What I've done is add an ID field to the source table, set to
autonumber, so that the previous record always has the latest number in that
field.

However, I'm now a bit stuck on what to put in the default value box. I want
the default to be the value of my "points-dailytarget" field in the record
where "ID" has the highest number. Any ideas please?

Many thanks,
Geoff.
 
G

Geoff

Just to add to my previous post, I am aware that I could put this code in
either the before update or on current box of the form:


If Not(Me.NewRecord) Then
Me.control1.DefaultValue = """" & Me.control1.Value & """"
End If


That doesn't always give me the previous value though. It seems to depend on
what I'm looking at before I select a new record. Maybe that code could be
adapted so it always gives the previous value?

Geoff.
 

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