G
Guest
Hello,
I'm using Access 2003. I a typical data-entry form with a ComboBox at the
top used to select the frist/last name of a person, and then the form fills
up with their data.
I noticed this strange behavior: If I select a person, say "Joe Smith", by
clicking on his name in the ComboBox, the form fills with his data, no
problem. Then if I open the drop-down again and click "Joe Smith" for the
second time, I get this error:
Update or CancelUpdate without AddNew or Edit
And here is the code:
Private Sub NameComboBox_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = '" & Me![NameComboBox] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark <--- this sometimes errors
rs.Close
Set rs = Nothing
If <some criteria> Then
Me.SomeControl = "" <--- this line sometimes errors
End If
End Sub
Any ideas?
Thanks,
-Scott
I'm using Access 2003. I a typical data-entry form with a ComboBox at the
top used to select the frist/last name of a person, and then the form fills
up with their data.
I noticed this strange behavior: If I select a person, say "Joe Smith", by
clicking on his name in the ComboBox, the form fills with his data, no
problem. Then if I open the drop-down again and click "Joe Smith" for the
second time, I get this error:
Update or CancelUpdate without AddNew or Edit
And here is the code:
Private Sub NameComboBox_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = '" & Me![NameComboBox] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark <--- this sometimes errors
rs.Close
Set rs = Nothing
If <some criteria> Then
Me.SomeControl = "" <--- this line sometimes errors
End If
End Sub
Any ideas?
Thanks,
-Scott