Results 1 to 5 of 5
  1. #1
    AccessThomas is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    26

    Error mismatch in macro

    My report was running fine then I started getting errors such as
    "A problem occurred while Microsoft Access was communicating with the OLE server or activex control."

    I looked at the macro for the combobox and tried to run it, and it says type mismatch.

    Nothing has changed in the database table.



    The code in the macro where condition is
    ="[Account Name] = " & "'" & [Screen].[ActiveControl] & "'"

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    Screen.activecontrol is not a string value.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    ranman, I don't understand your comment. The reference to ActiveControl is intended as a variable, not literal string.

    Something somewhere has to have changed.

    Might explicitly name the control that is to provide the value.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Since you are using a combo box, my guess is that Screen.activecontrol does not yield the value you think it does. If the combo box has a hidden column (Width = 0) as the bound column, then Screen.Activecontrol will give you the value in that hidden column, and not the text you see.

    If you want to refer to the text you see in the combo box, then use Screen.Activecontrol.Column(1)


  5. #5
    AccessThomas is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    26
    Got it working, just had to copy everything to a new form.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-13-2015, 01:33 PM
  2. Replies: 7
    Last Post: 07-24-2013, 02:01 PM
  3. Error: Run-time error '13' Type mismatch
    By uronmapu in forum Access
    Replies: 1
    Last Post: 09-07-2012, 05:38 AM
  4. Replies: 1
    Last Post: 05-11-2012, 10:59 AM
  5. Type mismatch in condition embedded macro
    By geremore in forum Programming
    Replies: 3
    Last Post: 08-09-2011, 02:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums