By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

why does it not work occasionally?

P: n/a
I have a main form (Main-member) with a cancel button. When user
click on the button, it open up another form (Frame40) and the user can
choose a cancel option and double click to close. But occasionally
the first 4 lines does not get executed. Does this has to do requery
issue?

Private Sub Frame40_DblClick(Cancel As Integer)
On Error GoTo Err_Frame40_DblClick
Dim rst, rst1 As DAO.Recordset
Me.DATECANCEL = Format(Now, "mm/dd/yy") 'form main_member
Me.CANCELS = True 'form
main_member
Me.csrID = CurrentUser() 'form
main_member
Me.cancellati = [conf] + [csrID] + Format(Now, "mm/dd/yy")
'form main_member
Set rst = CurrentDb.OpenRecordset("DailyReport", dbOpenDynaset)
With rst
rst.AddNew
rst!conf = conf
rst!csrID = CurrentUser
rst!cxlreason = Me.Frame40
rst.Update
End With
rst.Close
Set rst = Nothing
With Forms![MAIN-members].Child135.Form
Set rst1 = .RecordsetClone
rst1.AddNew
rst1!conf = conf
rst1!csrID = CurrentUser
rst1!csdate = DATE
rst1!comments = "cxl"
rst1.Update
rst1.Bookmark = rst1.LastModified
End With
rst1.Close
Set rst1 = Nothing
DoCmd.Close acForm, "cancel", acSaveYes
Exit_Frame40_DblClick:
Exit Sub
Err_Frame40_DblClick:
MsgBox Err.Description
Resume Exit_Frame40_DblClick
End Sub

May 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.