J
Joe Bohen
I need to know if a query has any records before my form
updates a table. I have the following code set in the
before update property of the form:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim cnn As Connection
Dim rstCards As New ADODB.Recordset
Set cnn = CurrentProject.Connection
rstCards.Open "qryCard_Validate", cnn, adOpenKeyset,
adLockOptimistic, adCmdTableDirect
If rstCards.RecordCount >= 1 Then
MsgBox "This record will create an overlap."
End If
End Sub
The run time error:
'-2147217904 (80040e10)': is generated when the code is
triggered.
I have spent Sunday afternoon trying to get my head round
this (sad) have I totaly missed the plot here or am I just
a parameter short of a program.
Help Appreciated
updates a table. I have the following code set in the
before update property of the form:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim cnn As Connection
Dim rstCards As New ADODB.Recordset
Set cnn = CurrentProject.Connection
rstCards.Open "qryCard_Validate", cnn, adOpenKeyset,
adLockOptimistic, adCmdTableDirect
If rstCards.RecordCount >= 1 Then
MsgBox "This record will create an overlap."
End If
End Sub
The run time error:
'-2147217904 (80040e10)': is generated when the code is
triggered.
I have spent Sunday afternoon trying to get my head round
this (sad) have I totaly missed the plot here or am I just
a parameter short of a program.
Help Appreciated