Mass DataEntry

kcolbert01

Registered User.
Local time
Today, 10:31
Joined
Jan 13, 2003
Messages
36
Here is my problem. I work in an area where we keep track of classes attended by employees. There is a set of 5 classes that are usually lumped together and the employees sign a sheet and check of which of the five classes they have taken (usually it's all 5 but occasionally some people only stay for one or two classes)

Then we get the sign up sheets and add them to the database. My question is: is there a way to enter this data more quickly? the records usually have 2 things in common - classtype and expiration date. Is there a way for me to only enter those 2 peices of data once and the coordinating fields just pick them up - so I only have to type in the employee info?

I hope this is clear.

Thanks.
 
try this!

my colleague put this code into one of our databases, I do not know a huge amount about it, but I tested it out and it seems to work. although you may need to find a way to specify/limit the fields you want to autofill..

also in the form in question in the on current event you must put

=AutoFillNewRecord([Forms]![yourform]) this will reference to the module ModAutoFillNewRecords

stick the code below into this module.

think you will have to play around with this, but post back with any queries and am sure if I cannot answer it (which is likely!!)there are plenty of people who will be able to help.

Good Luck!
John.


Option Compare Database
Option Explicit

Function AutoFillNewRecord(F As Form)
Dim RS As Recordset, C As Control
Dim FillFields As String, FillAllFields As Integer

On Error Resume Next

'Exit if not on the new record.
If Not F.NewRecord Then Exit Function

'Goto the last record of the form recordset (to autofill form)
Set RS = F.RecordsetClone
RS.MoveLast
'Exit if you cannot move to the last record(no records).
If Err <> 0 Then Exit Function

'Get the list of fields to autofill.
FillFields = ";" & F![AutoFillNewRecordFields] & ";"

'If there is no criteria field, then set flag indicating ALL
'fields should be autofilled.
FillAllFields = Err <> 0

F.Painting = False

'Visit each field on the form.
For Each C In F
'Fill the field if ALL fields are to be filled OR if the
'...ControlSource field cn be found inthe FillFields list.
If FillAllFields Or InStr(FillFields, ";" & (C.Name) & ";") > 0 Then
C = RS(C.ControlSource)
End If
Next

F.Painting = True

End Function
 

Users who are viewing this thread

Back
Top Bottom