Microsoft
Software
Hardware
Network
Question : Before Update Event in Combo Box Cancel event
This is my code and attached are examples of errors I get.
Statement "Cancel = True" is causing the problem.
Error1 happens only in this example, but Error2 happens in all my combo boxes on various forms throughout the project where I have Cancel = True in the Before Update Event.
Private Sub Client_ID_BeforeUpdate(Can
cel As Integer)
If Nz(DLookup("[Client ID]", "[tblAttendance]", "[Session ID] = " & _
Nz(Forms![frmSessionAttend
ance].Form
.Recordset
.[Session ID], 0) & _
"AND [Client ID] = " & Nz(Me.[Client ID], 0)), 0) <> 0 Then
MsgBox "This client already exists on this list."
Me.Client_ID.Undo
Cancel = True
End If
End Sub
Answer : Before Update Event in Combo Box Cancel event
If you cancel the before update event of a control then you also need to cancel the form before update event and handle the form undo event. See
www.thenelson.name/#Report
FormTricks
, "Check for required items" for details on how to do it.
Random Solutions
SBS 2008 / Exchange Server 2007/Outlook 2007 Sync Error 0X80072F06 - Offline Address Book
Earliest and latest times each day - mdb query
Create Table on the fly for BULK Insert
Get month by month total count
Duplicate Resource IDs
Network driver for Acer one - Model za3 ------ ao751h (Intel atom 1.3 Ghz)
Content page load vs event on master page.
COleDateTime::GetCurrentTi<wbr />me when used with Other than Main Thread Gives Exception and strange behaviour
export wordperfect 8 file to file from FoxPro General Field
Windows 7 Pro BSOD Teefer2.sys