My group uses a scope document to kick-off projects. The scope document is a
word document with several fields. I have created a database to accomplish
two things: 1. Automate a few of the inputs with drop-down menus; 2. Store
the scope document information in a searchable database so it is more useful
to us than a word document.
The data is primarily in a single table (besides the tables to control the
drop-downs) with the following fields:
ID #: text field with our project designation, of the form PRJ-0001
NAME: text field with title of project
DESCRIPTION: memo field with detailed project description
START_DATE: date field
COMPLETION_DATE: date field
STATUS: text field from drop-down
MODEL_TYPE: text field from drop-down (type of analysis project)
LOADING_DESC: memo field with details of how the model is loaded
INSPECTION: memo field with details on inspection of the part
DELIVERABLES: memo field describing the deliverables
ACCEPTANCE_CRIT: memo field with the acceptance criteria for the analysis
SUMMARY: memo field with executive summary of project results
In addition, there are several check boxes and codes that are in this table.
Currently, the table has about 1200 records in it from projects that have
been completed or are in progress. One of the users requested the ability to
create a new record from an existing record. For example, he may have a
project that is similar to one he did 2 years ago. The model type, loading,
deliverables, acceptance criteria, and description may be very similar. In
the past, he would copy the existing .doc file and make the minor changes to
create the new scope document. He wants the same functionality now. Select
an existing record to copy from, and then open the record to make changes to
the fields that are not the same. In some cases, for example, you may change
1 out of the 4 paragraphs in the acceptance criteria section, leave the
loading the same, etc.
You stated that if 8 of the 10 fields were going to be the same as an
existing record, I should have those fields as one record in another table.
The problem is that one record may have the same loading and acceptance
criteria as PRJ-1000, another record may have the same acceptance criteria
and inspection as PRJ-1001, and another record may have 5 fields similar to
but not quite the same as PRJ-1002. Does that make sense? If that can be
handled by splitting off some of the fields into another table, that is way
over my head.
I was able to accomplish this with the following code (based on some code I
found on a knowledge base search on Microsoft), using text boxes with names
that start with "copy" for the fields that I wanted to copy:
Function AutoFillNewRecord()
'##### code to copy data from previous record
Dim RS As DAO.Recordset, F As field, c As Control
On Error Resume Next
If Not Me.NewRecord Then Exit Function
Set RS = Me.RecordsetClone
RS.MoveFirst
If Err <> 0 Then Exit Function
Me.Painting = False '### temporarily stop repaints
For Each c In Me '### copy each of the specified fields
If Left(c.Name, 4) = "copy" Then
c = RS(c.ControlSource)
End If
Next
Me.Painting = True '### restart repaints
End Function
It seems to work, but I would be glad to hear any ideas you may have to
improve the design, or any problems you see with the method I'm using.
Thanks!