BeginTrans

From: Monzer George Yazigi (monzer_yazigi_at_NOSPAM.hotmail.com)
Date: 12/31/04


Date: Fri, 31 Dec 2004 19:19:54 +0300

Dear All
I have MSAccess 2003 Database file, with an ADO connection to it.
I have two tables Master and Details within the database.

I have the following steps:

1. ADO Connection Begin Transaction
2. Master Table: Insert New Record
3. Detail Table: Insert New Record Related to Inserted record in the
master
4. I have OnNewRecord Event assigned to the Detailed Table to set the
Key value related to the Master Table

5. DBGrid assigned to the detailed table.

Problem:
When filling in a record through the DBGrid, everything works fine
until I try to insert a new record, I get a message saying:

"You can not add or change a record because a related record is
required in table "Master Table"

Anybody can help me here?

I know I can post the master table and then proceed. But thats not
what I need. The problem happens is the user decided to cancel the
transaction, then I have to manully delete the master reocrd. While I
need to have the TransCommit and RollbackTrans function do the job for
me?

Regards



Relevant Pages

  • RE: Update Client copy of Forms and Reports
    ... store the company data (it is refered to as Master) and a database file ... The system alows users to read ...
    (microsoft.public.access.macros)
  • Then how to do...
    ... I need to creat a new invoice lets say with the list of items within ... >I have MSAccess 2003 Database file, with an ADO connection to it. ... Master Table: Insert New Record ... >transaction, then I have to manully delete the master reocrd. ...
    (borland.public.delphi.database.ado)
  • Re: Update and Append Query
    ... UPDATE Master RIGHT JOIN [Transaction] ... "Tom Lake" wrote: ... One query will do both. ...
    (microsoft.public.access.queries)
  • Re: Simply adding two fields
    ... I'm reading a transaction file of widgets delivered and I want to update the ... quantity in the master record, so I do a query joining the master and ... Just redo the calculation whenever you need it, ...
    (microsoft.public.access.queries)
  • Re: Indicating Stored Procedure progress on Form
    ... connection used by Access to open the second form. ... 2- A transaction is open when the master SP is called, ... writes are then part of this transaction and won't be visible from the ... the form requeries and the completed ...
    (microsoft.public.access.adp.sqlserver)