Thanks for the reply Jeff. The need for a duplicate record is kind of a
misnomer. What I am trying to do is allow the user to use the vast
majority
of a Project record (i.e. wheel1) in order to create a new iteration (new
record) for that Project. We analyze wheels and as such, all wheels are
subject to a battery of analyses and each individual analysis is given a
new
iteration (sometimes up to 30 iterations per wheel). I have got the
command
button set for creating new projects and editing existing iterations, but
I
am having difficulty creating new iterations.
We have two basic types of analyses, Structural (about 20 different tests)
and Process (Thermal). Each type has specific data required in order to do
an
analysis, so the tables are designed to accommodate each one. About the
only
items that are used by both is the WheelName, Project Number, Project
Engineer and some CAE data. This data is defined in it's own table. The
other data required is stored in different tables and are linked via
foreign
keys.
The code is below.
Private Sub cmdAddUpdate_Click()
Select Case Me.cmdAddUpdate.Caption
Case "Add"
Select Case Forms!fmMasterform!lblHeader.Caption
Case "FEA Projects Page - New Iteration"
If Me.tbFIteration.Value = DLookup("[FIteration]",
"[qyfea]", "[WheelName] ") Then
MsgBox "This wheel already uses this iteration",
vbCritical, "New Iteration"
Me.tbFIteration.SetFocus
End If
If MsgBox("Do you want to save new Iteration?", vbYesNo,
"New Iteration") = vbNo Then
DoCmd.RunCommand acCmdUndo
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70
'Paste Append
Forms!fmMasterform.testfea1.Form.Requery
End If
Case "FEA Projects Page - New Project"
If MsgBox("Do you want to save changes?", vbYesNo, "Save
Changes") = vbNo Then
DoCmd.RunCommand acCmdUndo
Else
DoCmd.GoToRecord , , acNewRec
Forms!fmMasterform.testfea1.Form.Requery
End If
End Select
Jeff Boyce said:
John
"textboxes" and "comboboxes" are not records, they're controls on a form.
What is the code "behind the button"? Please post the SQL statement.
It would be somewhat unusual to have a well-normalized database design
that
required you to "duplicate a record". Since it all starts with the data,
perhaps you could describe a bit more specifically what data you are
trying
to duplicate, so the newsgroup readers can offer more specific
suggestions.
Good luck!
Regards
Jeff Boyce
Microsoft Office/Access MVP
I have created a button that is supposed to duplicate a record, but
every
time I try it , I get the following:
"Record(s) that CAE Project was unable to paste have been inserted into
a
new table..."
1) The new table creates 2 frames (frame 75 and Frame 175), but I do
not
know what they are linked to. How can I repair what I can't decipher.
Is
there a way I can debug it?
2) Is there a way that I can copy a record to a new record (47
textboxes
and
4 combo boxes)? If so, can someone direct me on how to accomplish
this?.
Thanks