Problem communicating with OLE server or ActiveX Control (1 Viewer)

Kiranpendy

Registered User.
Local time
Today, 05:42
Joined
Sep 3, 2019
Messages
15
I have a form in which i put a button and built a "on-click" command. I've attached the error file along with this thread. This only started to occur once i put the on-click VBA in. It was working fine before that. When I click on the help section i get the following message:
"This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs."
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 05:42
Joined
Oct 29, 2018
Messages
21,357
Hi.Which button are you referring to and what is the code you're using for it?
 

Kiranpendy

Registered User.
Local time
Today, 05:42
Joined
Sep 3, 2019
Messages
15
This is the code:
Private Sub Command455_Click()

Dim strSQL1 As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim strSQL4 As String

strSQL1 = "INSERT INTO MOTReviewIterations ( fk_project_id, [Date], [Is the project located on an arterial street, " _
& "located in a comme], [A Traffic Control Plan is Required], [Can a MUTCD, IDOT or CDOT MOT Standard be used in lieu of a site], [An MUTCD, IDOT or CDOT MOT Standard is acceptable], [A Site specific Traffic Control Plan (TCP) is required], [For residential streets an MUTCD, IDOT and CDOT MOT Standard is], [Does the project require a full or partial closure of an arteria], [Detour plan is required], [Detour Plan is not required for residential street closures], [MOT General Notes Sheet], [MOT Plan View Sheets], [MOT Typical Cross Section Sheets], [MOT Standard Sheets are included and listed on the Cover Sheet], [MUTCD Standards (if applicable)], [IDOT Standards (if applicable)], [CDOT Standards (if applicable)], [Site specific and traffic control notes are listed], [Contact information for impacted agencies is listed, including n], [Contact information for neighboring municipalities is listed whe], [Correct drawing scale used], [North Arrow is shown correctly], " _
& "[Street names, including state and county highways, are labeled a], [Streets are labeled with addresses based on distances from State], [Alleys and driveways are labeled], [CTA, Metra and freight railroad lines are shown when applicable], [General staging notes are listed], [Requested work hours, lane closure hours, and road closure hours], [Legend is shown and all elements used are listed in the Legend], [Signs are shown with Sign Designation number], [Existing sidewalk widths and crosswalks are shown], [Pedestrian accommodations are provided (if necessary)], [ADA access is maintained at all locations], [Sidewalk and/or temporary pedestrian walkway dimensions are show], [Pedestrian detour and sidewalk closed signage is provided (if ne], [Pedestrian sign types are shown and dimensioned], [Pedestrian access to businesses is maintained], [Pedestrian accommodations are made for transit users including M], [Metra Rail stops are labeled and access to Metra stations is mai], [CTA Rail stops are labeled" _
& " and access to transit stations is mai], [CTA bus stop locations are labeled, including Pace if applicable], [Bus stop locations are relocated if necessary, and called out], [Existing bike lane widths, pavement markings and infrastructure], [Bicycle accommodations, including a signed detour, are provided], [Bicycle sign types are shown and dimensioned], [Bicycle lane taper is provided and dimensioned], [Bicycle lane width is dimensioned], [Existing roadway and lane width dimensions are shown], [Existing speed limit is listed, and the proposed speed limit if], [Existing pavement markings are shown], [Existing traffic lanes, including left]turn, through and right]t], [Existing bike lanes, pavement markings, and bike infrastructure], [Existing sidewalks and crosswalks are shown], [Work zone length dimensions are shown], [Temporary roadway and lane width dimensions are shown], [Temporary pavement markings are shown], [Traffic control barrier type is listed and shown (if applicable)], " _
& "[Advanced roadway signs are provided], [Side street roadway signs are provided], [Sign spacing and sign locations are dimensioned], [Taper types are listed and taper lengths are dimensioned], [Number of channeling devices and the spacing of devices along th], [Work zone and closure locations are shown], [Street and direction of travel closed is clearly shown], [Viaduct clearances are shown on the original and the detour rout], [Proposed closure hours are listed], [Detour route is shown for vehicles including cars, trucks, trans], [Wayfinding signage for all impacted modes of transportation is s], [Neighboring municipalities impacted by the detour are listed and], [Number of traffic lanes is noted and labeled],
turn, through and right]turn lanes are labeled], [Directions of travel are noted], [Lane width dimensions], [Work zone dimensions], [Traffic control barrier type and dimensions are shown], [Typical Cross sections can be shown on the Plan Sheets as space], [Overall Project Desig" _
& " Comments], [MOT Plan Sheets to be included in submittal package Comments], [MOT General Notes Comments], [MOT Plan View Sheets Comments], [Pedestrian Elements Comments], [Transit Elements Comments], [Bicycle Elements Comments], [Roadway Elements Comments], [Detour Plan Comments], [MOT Typical Cross Section Sheets Comments], [General Comments], Createdby, CreatedDate, Updatedby, UpdatedDate, bca_rfi, [Quality Lead Comments], MOTReviewed_Date, Iterations, MOT_Date_Accepted )" _



strSQL2 = "SELECT MOTReviewT.fk_project_id, MOTReviewT.[Date], MOTReviewT.[Is the project located on an arterial street, " _
& "located in a comme], MOTReviewT.[A Traffic Control Plan is Required], MOTReviewT.[Can a MUTCD, IDOT or CDOT MOT Standard be used in lieu of a site], MOTReviewT.[An MUTCD, IDOT or CDOT MOT Standard is acceptable], MOTReviewT.[A Site specific Traffic Control Plan (TCP) is required], MOTReviewT.[For residential streets an MUTCD, IDOT and CDOT MOT Standard is], MOTReviewT.[Does the project require a full or partial closure of an arteria], MOTReviewT.[Detour plan is required], MOTReviewT.[Detour Plan is not required for residential street closures], MOTReviewT.[MOT General Notes Sheet], MOTReviewT.[MOT Plan View Sheets], MOTReviewT.[MOT Typical Cross Section Sheets], MOTReviewT.[MOT Standard Sheets are included and listed on the Cover Sheet], MOTReviewT.[MUTCD Standards (if applicable)], MOTReviewT.[IDOT Standards (if applicable)], MOTReviewT.[CDOT Standards (if applicable)], MOTReviewT.[Site specific and traffic control notes are listed], MOTReviewT" _
& ".[Contact information for impacted agencies is listed, including n], MOTReviewT.[Contact information for neighboring municipalities is listed whe], MOTReviewT.[Correct drawing scale used], MOTReviewT.[North Arrow is shown correctly], MOTReviewT.[Street names, including state and county highways, are labeled a], MOTReviewT.[Streets are labeled with addresses based on distances from State], MOTReviewT.[Alleys and driveways are labeled], MOTReviewT.[CTA, Metra and freight railroad lines are shown when applicable], MOTReviewT.[General staging notes are listed], MOTReviewT.[Requested work hours, lane closure hours, and road closure hours], MOTReviewT.[Legend is shown and all elements used are listed in the Legend], MOTReviewT.[Signs are shown with Sign Designation number], MOTReviewT.[Existing sidewalk widths and crosswalks are shown], MOTReviewT.[Pedestrian accommodations are provided (if necessary)], MOTReviewT.[ADA access is maintained at all locations], MOTReviewT.[Sidewalk and/or temporary " _
& "pedestrian walkway dimensions are show], MOTReviewT.[Pedestrian detour and sidewalk closed signage is provided (if ne], MOTReviewT.[Pedestrian sign types are shown and dimensioned], MOTReviewT.[Pedestrian access to businesses is maintained], MOTReviewT.[Pedestrian accommodations are made for transit users including M], MOTReviewT.[Metra Rail stops are labeled and access to Metra stations is mai], MOTReviewT.[CTA Rail stops are labeled and access to transit stations is mai], MOTReviewT.[CTA bus stop locations are labeled, including Pace if applicable], MOTReviewT.[Bus stop locations are relocated if necessary, and called out], MOTReviewT.[Existing bike lane widths, pavement markings and infrastructure], MOTReviewT.[Bicycle accommodations, including a signed detour, are provided], MOTReviewT.[Bicycle sign types are shown and dimensioned], MOTReviewT.[Bicycle lane taper is provided and dimensioned], MOTReviewT.[Bicycle lane width is dimensioned], MOTReviewT.[Existing roadway and lan" _
& "e width dimensions are shown], MOTReviewT.[Existing speed limit is listed, and the proposed speed limit if], MOTReviewT.[Existing pavement markings are shown], MOTReviewT.[Existing traffic lanes, including left]turn, through and right]t], MOTReviewT.[Existing bike lanes, pavement markings, and bike infrastructure], MOTReviewT.[Existing sidewalks and crosswalks are shown], MOTReviewT.[Work zone length dimensions are shown], MOTReviewT.[Temporary roadway and lane width dimensions are shown], MOTReviewT.[Temporary pavement markings are shown], MOTReviewT.[Traffic control barrier type is listed and shown (if applicable)], MOTReviewT.[Advanced roadway signs are provided], MOTReviewT.[Side street roadway signs are provided], MOTReviewT.[Sign spacing and sign locations are dimensioned], MOTReviewT.[Taper types are listed and taper lengths are dimensioned], MOTReviewT.[Number of channeling devices and the spacing of devices along th], MOTReviewT.[Work zone and closure locations are shown], " _
& "MOTReviewT.[Street and direction of travel closed is clearly shown], MOTReviewT.[Viaduct clearances are shown on the original and the detour rout], MOTReviewT.[Proposed closure hours are listed], MOTReviewT.[Detour route is shown for vehicles including cars, trucks, trans], MOTReviewT.[Wayfinding signage for all impacted modes of transportation is s], MOTReviewT.[Neighboring municipalities impacted by the detour are listed and], MOTReviewT.[Number of traffic lanes is noted and labeled], MOTReviewT.
turn, through and right]turn lanes are labeled], MOTReviewT.[Directions of travel are noted], MOTReviewT.[Lane width dimensions], MOTReviewT.[Work zone dimensions], MOTReviewT.[Traffic control barrier type and dimensions are shown], MOTReviewT.[Typical Cross sections can be shown on the Plan Sheets as space], MOTReviewT.[Overall Project Design Comments], MOTReviewT.[MOT Plan Sheets to be included in submittal package Comments], MOTReviewT.[MOT General Notes Comments], MOTReviewT." _
& "[MOT Plan View Sheets Comments], MOTReviewT.[Pedestrian Elements Comments], MOTReviewT.[Transit Elements Comments], MOTReviewT.[Bicycle Elements Comments], MOTReviewT.[Roadway Elements Comments], MOTReviewT.[Detour Plan Comments], MOTReviewT.[MOT Typical Cross Section Sheets Comments], MOTReviewT.[General Comments], MOTReviewT.Createdby, MOTReviewT.CreatedDate, MOTReviewT.Updatedby, MOTReviewT.UpdatedDate, MOTReviewT.bca_rfi, MOTReviewT.[Quality Lead Comments], " _
& "MOTReviewT.MOTReviewed_Date, MOTReviewT.Iterations, MOTReviewT.MOT_Date_Accepted FROM [MOTReviewT]"

strSQL3 = "WHERE ChecklistID = " & Me.ChecklistID & ";"
strSQL4 = strSQL1 & strSQL2 & strSQL3

messagebox = strSQL4

DoCmd.SetWarnings False

DoCmd.RunSQL strSQL4

DoCmd.SetWarnings True


End Sub

It still throws the "A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX control" even if I comment out the code.​
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:42
Joined
May 7, 2009
Messages
19,169
you have long field name with space there, try to shorten them or replace space with underscore.

the limit for field name length is 64 chars.

try breaking your strSQL1 and strSQL2:

strSQL1 = "select …"
strSQL1 = strSQL1 & "..continue here"
strSQL1 = strSQL1 & "..continue here"
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:42
Joined
Sep 21, 2011
Messages
14,038
You do not appear to have spaces between those absolutely huge strings ?

Try debug.print strSQL4 and see what that produces.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:42
Joined
May 7, 2009
Messages
19,169
there are many cause for this errors.
2 I can think of is when you edit the orig code is x32 and you edit the code in x64, vice versa.
the other is when you edit the vba from another access whose language is not English.
 

Kiranpendy

Registered User.
Local time
Today, 05:42
Joined
Sep 3, 2019
Messages
15
Gasman - The error isn't from the code because commented out the code and it still throws the same error. I have three other forms that follow the same naming conventions , same code and the same process and they work fine. I'm pretty new to MS Access.

Arnelgp - I do not have the administrative rights to change or check the language. Is there a way to handle the x32 and x64 issue? '

I'm attaching the zipped version of the DB and the backend tables to the original post.

Thanks,
Srikiran
 

Kiranpendy

Registered User.
Local time
Today, 05:42
Joined
Sep 3, 2019
Messages
15
Gasman - The error isn't from the code because commented out the code and it still throws the same error. I have three other forms that follow the same naming conventions , same code and the same process and they work fine. I'm pretty new to MS Access.

Arnelgp - I do not have the administrative rights to change or check the language. Is there a way to handle the x32 and x64 issue? '

I'm attaching the zipped version of the DB to this message!!!!
Thanks,
Srikiran
 

Attachments

  • Test_Database.zip
    1,013.8 KB · Views: 132

JHB

Have been here a while
Local time
Today, 13:42
Joined
Jun 17, 2012
Messages
7,732
..<br>
I'm attaching the zipped version of the DB to this message!!!!<br>
Thanks,<br>
Srikiran
<br>
The backend database isn't attached and because you removed the picture in the first post, you need to tell the form name!
 

Kiranpendy

Registered User.
Local time
Today, 05:42
Joined
Sep 3, 2019
Messages
15
JHB : I've attached the backend to this post! Sorry about that.
 

Attachments

  • Practice_Database_be - Copy.accdb
    1.6 MB · Views: 100

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:42
Joined
May 7, 2009
Messages
19,169
still missing 1 table for form_mot_tab.
 

Kiranpendy

Registered User.
Local time
Today, 05:42
Joined
Sep 3, 2019
Messages
15
I'm attaching the backend again! This has all the tables required. The table for the frm_mot_tab is "MOTReviewT"


Thanks and sorry for the inconvenience!
 

Attachments

  • Practice_Database_be_Copy.zip
    182.6 KB · Views: 98

JHB

Have been here a while
Local time
Today, 13:42
Joined
Jun 17, 2012
Messages
7,732
The problem is related to two of the controls in the form, so first delete them from the form, then run the form and click the button to test if all is okay.
Then create them from new.
The first control is no: 4 in the first section in the "Roadway Elements".
The second control is no:2 in "MOT Typical Cross Section Sheets"

I have attached a database without the two controls, run it and see if you get an error message.
 

Attachments

  • Database68.zip
    740.2 KB · Views: 110

JHB

Have been here a while
Local time
Today, 13:42
Joined
Jun 17, 2012
Messages
7,732
Good you got the problem solved! :)
 

AccessBlaster

Registered User.
Local time
Today, 05:42
Joined
May 22, 2010
Messages
5,823
You can say the problem is solved but, your field names have tons of issues. One issue is the field name date is a reserved word in Access.

Number 2 your field names are so large with special characters, they are essentially data not field names.

Below will be a nightmare for anybody that has to work on this.


 

Attachments

  • Capture.PNG
    Capture.PNG
    39 KB · Views: 964

Users who are viewing this thread

Top Bottom