Event Procedure Error Combo-box query update

RJGoodhead

Registered User.
Local time
Today, 22:16
Joined
Feb 16, 2012
Messages
14
Earlier today I copied a working form to create 2 variations.

It has combo-boxes which requery following the update of another box.
The update event procedure is
Code:
Private Sub Division_AfterUpdate()
    Me.SalesManager = vbNullString
    Me.SalesManager.Requery
    Me.CostCentre = vbNullString
    Me.CostCentre.Requery
End Sub
and an example of the query is
Code:
SELECT SaleManagerTable.Initials
FROM SaleManagerTable
WHERE (((SaleManagerTable.Division)=[Forms]![InvAlloBrowseForm]![Division]));
Whenever I update I see the following error
The expression After Update you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control
The original form still works, but these 2 copies both show the same error. I've checked the code and queries a dozen times against each other but can't find any reason for it. Any help is much appreciated
 
Have you changed the highlighted portion of the SQL to match each form?
Code:
SELECT SaleManagerTable.Initials
FROM SaleManagerTable
WHERE (((SaleManagerTable.Division)=[Forms]![[COLOR="Red"]InvAlloBrowseForm[/COLOR]]![Division]));
I'm also assuming you've not changed any of the control names on the new forms.
 
Have you changed the highlighted portion of the SQL to match each form?
Code:
SELECT SaleManagerTable.Initials
FROM SaleManagerTable
WHERE (((SaleManagerTable.Division)=[Forms]![[COLOR=red]InvAlloBrowseForm[/COLOR]]![Division]));
I'm also assuming you've not changed any of the control names on the new forms.
Just checked again this morning, the form name is definitely correct on the control. I used the prompting on the query builder to confirm too.
I've not changed the control names and have checked these too.
I have a dsum statement on the form using the [Forms]![FormName]![ControlName] structure as criteria and this has failed too.
Is it possible the form was corrupted somehow when i created the copy?
 
I just copied the same form as an experiment, but this time copy paste with the form closed rather than F12 with it open. This new copy works fine, once the links have been changed.

I think I'll go through the same process as I did with the other form to see if I broke it whilst adding buttons and changing propeties.

I'm keeping the non-working forms so any suggestions on what might be wrong are still more than welcome. Otherwise I'll post back here with whatever I find.
 
I have no done everything to the new form that I did to the old; adding navigation buttons, adding form opening buttons, copied the copy, made one a data entry form, the other not accept new records.

As far as I can tell this did not cause any issues.

As the new forms have all the functionality I planned it is not necessary to fix the old forms. I am keeping them for now, if anyone has a suggestion I can test and learn from.

Other than that, thank you for you time looking at this thread.
 

Users who are viewing this thread

Back
Top Bottom