My Assistant
|
|
Mar 31 2012, 12:33 PM
Post
#1
|
|
|
UtterAccess Ruler Posts: 1,291 From: Kampala,Uganda The Pearl of Africa |
Hello UA
I have main form with a continuous sub form I want the user to be able to commit all edits once. So i have this global constant in a module CODE Public blInTransaction As Boolean in the subform dirty event i have CODE Private Sub Form_Dirty(Cancel As Integer) 'user starts an edit, and start a transaction if required If blInTransaction = False Then ' if not in a transaction then start one DBEngine.BeginTrans End If blInTransaction = True End Su In the open event of the subform i have CODE Private Sub Form_Open(Cancel As Integer) Dim rs As DAO.Recordset Set rs = Me.RecordsetClone blInTransaction = False End Sub On the main form i have the save button CODE Private Sub cdmSave_Click() If blInTransaction = True Then If MsgBox("Do you want to commit all changes?", vbYesNo) = vbYes Then DBEngine.CommitTrans dbForceOSFlush Else DBEngine.Rollback End If End If End Sub If i change record on subform, and click save, the message box appears, but it looks like the changes are already committed because clicking no does not undo the changes. Anyway to make it work? I am open to an alternative solution Ronald |
|
|
|
arnelgp If it is a bound form/controls then the save is au... Mar 31 2012, 12:42 PM
Kamulegeya QUOTE (arnelgp @ Mar 31 2012, 08:42 PM) I... Mar 31 2012, 12:56 PM
arnelgp If you swith from Main form to subform or vice ver... Mar 31 2012, 01:09 PM
Kamulegeya It seems no subform event can help me pull off thi... Mar 31 2012, 01:58 PM
BananaRepublic The only way to do this with a bound form is with ... Mar 31 2012, 04:35 PM![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 11:57 AM |