I have a form that I use to set the owner of the DB (so it only allows the user to create one record), with a combobox and a number of textboxes. The textboxes are populated by choosing a record from the combobox. I have found on occasion that I get the following error message:
Update or CancelUpdate without AddNew or Edit. It has an OK and a Help button but the Help gives no help! Pressing OK will remove the message but wont allow me to do anything eles with the form as the error comes back again.
I have a checkbox that hides the combobox once a selection has been made, the error always occurs when I have selected from the combobox, the same record that is already populated into the textboxes and then selectined the checkbox.
I guess I need some error handling in here but Im unsure what or how!
My code for the combobox is:
Update or CancelUpdate without AddNew or Edit. It has an OK and a Help button but the Help gives no help! Pressing OK will remove the message but wont allow me to do anything eles with the form as the error comes back again.
I have a checkbox that hides the combobox once a selection has been made, the error always occurs when I have selected from the combobox, the same record that is already populated into the textboxes and then selectined the checkbox.
I guess I need some error handling in here but Im unsure what or how!
My code for the combobox is:
Code:
Private Sub cbo_DatabaseOwner_AfterUpdate()
On Error GoTo cbo_DatabaseOwner_AfterUpdate_Err
DoCmd.SearchForRecord , "", acFirst, "[ContactID] = " & Str(Nz(Screen.ActiveControl, 0))
cbo_DatabaseOwner_AfterUpdate_Exit:
Exit Sub
cbo_DatabaseOwner_AfterUpdate_Err:
MsgBox Error$
Resume cbo_DatabaseOwner_AfterUpdate_Exit
End Sub