Saving a Newly Created Record
From: Lloyd (anonymous_at_discussions.microsoft.com)
Date: 09/01/04
- Next message: annanomus_at_msn.com: "I get an error when I try to create a combo box from the wizard"
- Previous message: mark r: "Re: acnormal problem"
- Next in thread: Bill: "Re: Saving a Newly Created Record"
- Reply: Bill: "Re: Saving a Newly Created Record"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 1 Sep 2004 10:30:54 -0700
My application has a summary table and two detail tables,
with one-to-one relationships between the summary table
and the detail tables. In the summary table I have a
button to go to the detail table. Code behind the button
opens the correct record in the correct detail table or
asks to create a new record. Below is the code to create
a new record in one of the detail tables - it "works"
(displays the correct data in a new record), but I am not
allowed to save the data. It says that I have a duplicate
value in an index.
If MsgBox("No Tracking Record Found. Create a New
One?", vbOKCancel) = vbOK Then
DoCmd.OpenForm "frmCTrackGenInfoDE", acNormal, , ,
acFormAdd
Me.[Grant#] = [Forms]![frmGrantSumDE].[Grant#]
Forms![frmCTrackGenInfoDE].[Grantee] = [Forms]!
[frmGrantSumDE].[Grantee]
Else
MsgBox ("Action Canceled")
End If
Note, that if I create a detail record that is not linked
to a record in the summary table, it saves fine. Grant#
is the key in all tables. I'm unsure if I need to focus
on the coding, bound fields or the original query to
resolve this problem.
Thanks for any help you can provide.
Lloyd
- Next message: annanomus_at_msn.com: "I get an error when I try to create a combo box from the wizard"
- Previous message: mark r: "Re: acnormal problem"
- Next in thread: Bill: "Re: Saving a Newly Created Record"
- Reply: Bill: "Re: Saving a Newly Created Record"
- Messages sorted by: [ date ] [ thread ]