G
gator
I get this error with the following code...You entered an expression that has
an invalid reference to the property Bookmark. Can someone tell me how to
correct it?
CODE:
Private Sub Command15_Click()
Dim mycon As New ADODB.Connection
Dim ADOrs As New ADODB.Recordset
Set mycon = CurrentProject.Connection
ADOrs.Open "AcctPayDetails", mycon, adOpenKeyset, adLockOptimistic
ADOrs.AddNew
ADOrs!Account = Me.Text10
ADOrs!Date = Me.Text16
ADOrs.Update
ADOrs.Close
ADOrs.Open "Accounts", mycon, adOpenKeyset, adLockOptimistic
ADOrs.Find "ID='" & Me!Text10 & "'"
If Not ADOrs.EOF Then
Me.Bookmark = ADOrs.Bookmark
ADOrs!ID = Me.Text10
ADOrs!AccountName = Me.Text12
ADOrs.Update
Else
ADOrs.AddNew
ADOrs!ID = Me.Text10
ADOrs!AccountName = Me.Text12
ADOrs.Update
End If
ADOrs.Close
mycon.Close
Me.Child20.Requery
Me.lstGroup.Requery
Me.List8.Requery
End Sub
an invalid reference to the property Bookmark. Can someone tell me how to
correct it?
CODE:
Private Sub Command15_Click()
Dim mycon As New ADODB.Connection
Dim ADOrs As New ADODB.Recordset
Set mycon = CurrentProject.Connection
ADOrs.Open "AcctPayDetails", mycon, adOpenKeyset, adLockOptimistic
ADOrs.AddNew
ADOrs!Account = Me.Text10
ADOrs!Date = Me.Text16
ADOrs.Update
ADOrs.Close
ADOrs.Open "Accounts", mycon, adOpenKeyset, adLockOptimistic
ADOrs.Find "ID='" & Me!Text10 & "'"
If Not ADOrs.EOF Then
Me.Bookmark = ADOrs.Bookmark
ADOrs!ID = Me.Text10
ADOrs!AccountName = Me.Text12
ADOrs.Update
Else
ADOrs.AddNew
ADOrs!ID = Me.Text10
ADOrs!AccountName = Me.Text12
ADOrs.Update
End If
ADOrs.Close
mycon.Close
Me.Child20.Requery
Me.lstGroup.Requery
Me.List8.Requery
End Sub