Repeat data on next record

G

Guest

How can I repeat data from previous record on fields that have the same data
from record to record. In other words I could have 10 records using the same
entry for product name then select another name for following record. Can
access remember entries from previous record while working on data entry
within a form?
 
J

Jeff Boyce

The first thing to confirm is that your underlying data/table structure is
well-normalized. It's a bit unusual (but not unheard of) to have to repeat
the same data in record after record. If you'll provide an example, the
newgroup should be able to determine if this is one of those exceptions.

If it proves to be necessary in your (data) situation, one way to accomplish
this would be to set the control's (or controls') Default value when saving
a record. That way, when the next (new) record is entered, the default
value in those controls has been preset to the previous record's values.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

missinglinq via AccessMonster.com

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

For Date fields:

Private Sub YourDateControlName_AfterUpdate()
If Not IsNull(Me.YourDateControlName.Value) Then
YourDateControlName.DefaultValue ="#" & Me.YourDateControlName & "#"
End If
End Sub
 

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