Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2014

    Unanswered: the expression on change you entered....

    Hi, everything was working well on my form, and then something happened.

    Basically I have a drop down list combobox (cboName) of names with blank columns, that populate other fields (cboCompany, cboShift, cboWorkgroup), except now I'm getting this random error: "The expression On Change you entered as the event property setting produced the following error: A problem occurred while Microsoft Access communicating with the OLE server or ActiveX Control."

    It was working, and there's not much code involved. I have no idea what's causing this!

    Private Sub cboName_Change()
    Me.cboCompany.Value = Me.cboName.Column(1)
    Me.cboShift.Value = Me.cboName.Column(3)
    Me.cboWorkgroup.Value = Me.cboName.Column(4)
    End Sub

  2. #2
    Join Date
    Apr 2004
    Derbyshire, UK
    Provided Answers: 1

    Have you teied using the AfterUpdate event instead of the Change event?

    Just a thought.


  3. #3
    Join Date
    Nov 2014
    Hi, thanks for the idea - unfortunately it doesn't matter if I do after update, after change, etc. I have no idea why it's doing this now.

  4. #4
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Quote Originally Posted by patri0t82 View Post

    ...I have a drop down list combobox (cboName) of names with blank columns...
    I'm somewhat curious as to exactly what is meant by 'blank columns' above.

    Having said that, this particular error message, especially when not actually associated with an OLE or ActiveX object, is often a sign of corruption, as is the on-again-off-again occurrence. I'd create a new file and import all objects into it and see what happens; often this is all that is needed to get rid of the Corruption Monster!

    Also, MTB's suggestion about moving the code to the AfterUpdate event of the Combobox, while not the answer to this problem, is worth doing. Having the code in the OnChange event means that it will be executed if the user enters a single character into the cbo, as he does if using the AutoExpand feature, and the incorrect data may be retrieved!

    If, for instance, a Combobox has the names

    Aaron Hank
    Adams John
    Anderson Harry

    and the user wants to retrieve data for John Adams, when he enters an 'A,' Aaron Hank's data will be retrieved and, if the code is in the OnChange event, that data, not John Adams' data, will be plugged in!

    Linq ;0)>
    Last edited by Missinglinq; 11-24-14 at 10:18.
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts