Hi,
I'm having a problem with an error message stating that I have a .cancelupdate without an .addnew or .edit. First of all, that's not true and second, it crops up at strange times.
I know you will want code, but believe me, you don't want to look at all the code I'd have to send to show you, so I'll try to give you the gist of it.
I have a form, frmProj for short, that is the main form of the application. With a brand new, empty database, a user can create a project. That's fine. The user can then add a Sponsor by choosing from a combo if there's any Resources available, or press a button to open a pop up dialog, AddResource to add Resources, if there are none or the one user wants is not there. This pop up does triple duty as there are a couple other places it can be called from.
For Sponsor, it takes the first and last names and adds them to the Resource table, and then assigns that resource to the Project as Sponsor. It is here that recordsets are created, opened, .addnew-ed and .updated. Nowhere in this area is there any .cancelupdate at all.
User is then returned to frmProj where they can now choose to assign a Manager to the project. The Process is identical except that now the resource is assigned to the Manager field. User is returned to frmProj.
Now this is where it gets dicey. When code execution returns to frmProjs module, frmProj is requeried to reflect the changes. It is at this point that I sometimes get the message about a .cancelupdate. I can't understand that. And, worse, the problem seems to cascade into other procedures if I trap it at it's original location. What I mean is that every time I try to requery the form, I get the .cancelupdate error again.
What can cause such baffling behaviour?
Also, I am getting write conflict messages at times when I try to add a Manager right after adding a Sponsor. This only occurs when the AddResource pop up is called, not when a resource is chosen from the combo. I have tried various solutions offered in previous posts, such as calling RunCommand accmdSaveRecord, but that doesn't seem to help.
I have an idea these problems are related, but I can't put my finger on the solution.
Thanks for any help.
Bear
I'm having a problem with an error message stating that I have a .cancelupdate without an .addnew or .edit. First of all, that's not true and second, it crops up at strange times.
I know you will want code, but believe me, you don't want to look at all the code I'd have to send to show you, so I'll try to give you the gist of it.
I have a form, frmProj for short, that is the main form of the application. With a brand new, empty database, a user can create a project. That's fine. The user can then add a Sponsor by choosing from a combo if there's any Resources available, or press a button to open a pop up dialog, AddResource to add Resources, if there are none or the one user wants is not there. This pop up does triple duty as there are a couple other places it can be called from.
For Sponsor, it takes the first and last names and adds them to the Resource table, and then assigns that resource to the Project as Sponsor. It is here that recordsets are created, opened, .addnew-ed and .updated. Nowhere in this area is there any .cancelupdate at all.
User is then returned to frmProj where they can now choose to assign a Manager to the project. The Process is identical except that now the resource is assigned to the Manager field. User is returned to frmProj.
Now this is where it gets dicey. When code execution returns to frmProjs module, frmProj is requeried to reflect the changes. It is at this point that I sometimes get the message about a .cancelupdate. I can't understand that. And, worse, the problem seems to cascade into other procedures if I trap it at it's original location. What I mean is that every time I try to requery the form, I get the .cancelupdate error again.
What can cause such baffling behaviour?
Also, I am getting write conflict messages at times when I try to add a Manager right after adding a Sponsor. This only occurs when the AddResource pop up is called, not when a resource is chosen from the combo. I have tried various solutions offered in previous posts, such as calling RunCommand accmdSaveRecord, but that doesn't seem to help.
I have an idea these problems are related, but I can't put my finger on the solution.
Thanks for any help.
Bear