Error "Update or CancelUpdate without AddNew or Edit"

gsanghvi20

New member
Local time
Today, 06:22
Joined
Jul 29, 2008
Messages
5
Hey guys,

I have a form which has a many text boxes and a combobox. One of the text boxes and the combobox form the composite PK. The value of the PK text box is taken from another from. And based on that I select the combobox values.

eg: I have the first name of a person in one txt box in one form, and the last name in the form of a combobx in another form.

Form 1:
First Name: John

Form 2:
First Name: John (disabled>value taken from Form 1)
Last Name: Drop down of available last names with John as a first name.
...
...
List of the other attributes in the table.

Now I want that when I select a Last Name it gives me all the attributes in the respective text boxes. I have done all the needful according to me. But the data in the respective text boxes on selecting the Last Name does not give me anything. When I go ahead and try to update any field it gives me an error: "Update or CancelUpdate without AddNew or Edit".

Please tell me what to do.
100.gif


Thanks,
gsanghvi20
 
In the Form2 code Module for the OnClick event of the Last Name Combo Box:
Code:
Me.RecordSource = "Select * From [I][COLOR="Red"]MyTableName[/COLOR][/I] WHERE FirstName=[B][COLOR="Red"]'[/COLOR][/B]" & _
                  Me.cboFirstName.Value & "[B][COLOR="Red"]'[/COLOR][/B] AND LastName=[B][COLOR="Red"]'[/COLOR][/B]" & _
                  Me.cboLastName.Value & "[COLOR="Red"][I]'[/I][/COLOR];"

.
 

Users who are viewing this thread

Back
Top Bottom