Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 18th, 2003, 02:18 AM
Registered User
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to elleetan Send a message via MSN to elleetan Send a message via Yahoo to elleetan
Default subform transaction

i had try this out to undo subform transactions, but i still got many bugs:

i have 3 tables:, Terminalfault, TerminalFaultDetail, Componetused
i had created form by using the above 3 tables:
the mainform is call FrmFault:

*** subform call subform1

***** subform call Component
      Component Number:
    Component Quantity

** for subform1 one faultNumber can have many fault , eg
  FaultNUmber = 111 Fault = 22
   faultnumber = 111 Fault = 23 and so on

** similiar to the Component subform
  Component Number = 1111 Component Quantity = 2
 Component NUmber = 1111 component Quantity = 3

i tried to apply the code of subforms transactions from microosoft access 2000 but i don't really understand it

this is my undo module:
Option Compare Database
Option Explicit

Private mwks As DAO.Workspace
Private mfIntrans As Boolean
Const adhcSource As String = "subform1"

*** but unfortunately i didn't create the query , so can i admit this line "Const adhcSource As String = "subform1"

Private Sub resetdata()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rst As DAO.Recordset
Dim prm As DAO.Parameter
Dim strsource As String

If mfIntrans Then
End If

Set mwks = DBEngine.CreateWorkspace("mwks", "Admin", "")
Set db = mwks.OpenDatabase(CurrentDb.Name)
Set qdf = db.QueryDefs(mstrsource)

For Each prm In qdf.Parameters
 prm.Value = Eval(prm.Name)
 Next prm
 Me.Painting = False
 Set rst = qdf.OpenRecordset
 rst.LockEdits = False
 Set Form_subform1.Form.recorset = rst
 Me.Painting = True

 mfIntrans = True

End Sub

** similiar to these code, i didn't create the query so it is not working, so do i modify it as i didn't create a query???

If mfIntrans Then
mfIntrans = False
Call resetdata
End If

Could you please help me , thank you very much!!!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transaction/Reflection ffbalota C# 2 October 6th, 2007 04:54 PM
Sub Transaction Problem gaurav_jain2403 SQL Server 2000 3 May 13th, 2006 10:53 AM
Transaction Logs kilika SQL Server 2000 17 September 30th, 2004 09:26 AM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM
how to use Transaction ? locka ADO.NET 0 August 12th, 2003 08:48 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.