Is there a way to do this so it will be automatic?

Signature
Thanks, Joy
> When you hold the ctrl key and click the apostrophe key ' access copies the
> contents of the same field from the previous record. This assumes that the
[quoted text clipped - 7 lines]
> > record). For example, I user has 100 entries - I would like to set up the
> > form so they do not have to enter their ID each time they enter a record.
Linq Adams - 30 Nov 2007 22:32 GMT
Sure, you just set the DefaultValue for the field in the field's AfterUpdate
event!
After a value is entered, in your date field, for instance, it will
automatically be entered in each new record thereafter until you change it
(in which case the new entry will become the default value) or you close down
the form
The syntax is slightly different, depending on the datatype.
For Date fields
Private Sub YourDateControlName_AfterUpdate()
If Not IsNull(Me.YourDateControlName.Value) Then
YourDateControlName.DefaultValue ="#" & Me.YourDateControlName & "#"
End If
End Sub
For Text fields
Private Sub YourTextControlName_AfterUpdate()
If Not IsNull(Me.YourTextControlName.Value) Then
YourTextControlName.DefaultValue = """" & Me.YourTextControlName.Value &
""""
End If
End Sub
For Numeric fields
Private Sub YourNumericControlName_AfterUpdate()
If Not IsNull(Me.YourNumericControlName.Value) Then
YourNumericControlName.DefaultValue = Me.YourNumericControlName.Value
End If
End Sub

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
sjf - 03 Dec 2007 17:51 GMT
That is what I am looking for. I've was able to get the "CTR + Apostrophe
(") to work but it only works for 1 record at a time and you have to keep
doing it for each new record.
> Is there a way to do this so it will be automatic?
>
[quoted text clipped - 9 lines]
> > > record). For example, I user has 100 entries - I would like to set up the
> > > form so they do not have to enter their ID each time they enter a record.
Linq Adams - 03 Dec 2007 21:11 GMT
Glad it helped!

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003