Announcements
We had a custom form with VBA that was working fine in GP 2016
After upgrading to 2018.3 the form is throwing an error Object Not Found 424 ( I have highlighted where the VBA breaks)
sqlstring = "SELECT isnull(sum(HOURSAVAILABLE_I),0) as HOURSAVAILABLE_I FROM TATM1030 WHERE TIMECODE_I = 'VACTC' and empid_I = '" & RTrim(EmployeeID) & "'"
' ADO Command
cmd.ActiveConnection = cn
' adCmdText
cmd.CommandType = 1
' Command
cmd.CommandText = sqlstring
Debug.Print sqlstring
' Pass through SQL
Set rst = cmd.Execute
If Not (rst.EOF And rst.BOF) Then
HRAttendEndBal1.Value = RTrim(rst!HOURSAVAILABLE_I) * 0.01
I understand VBA is going away - but this is simple form that has been working for sometime and now after the upgrade it is broken.
Thanks
We have had success running VBA code after adding Dynamics.exe to the DEP exceptions list.
Open Windows Control Panel and select System and Security.
Select System
Select Advanced system settings.
Select the Advanced tab in the System Properties window, then select Settings under Performance.
Select the Data Execution Prevention tab
select "Turn on DEP for all programs and services except those I select."
Select Add and then browse to Dynamics.exe and then apply.
VBA enables an error-handling routine and can also be used to disable an error-handling routine. Without an On Error statement, any run-time error that occurs is fatal: an error message is displayed, and the execution stops abruptly.
What are Compile Errors? Compile errors refer to a wider group of VBA errors, which include syntax errors. Compile errors also identify problems with your code when considered as a whole. The syntax of each individual line may be correct, but when put together, the lines of your code don't make sense.
I haven't touched Modified forms for a great while but my gut says that it is looking for a field you added named HRAttendEndBal1 on your modified form and cannot find it. You could go into modifier and add it again (or see if it is already there. Did you check that the SQL still returns a value? I assume you checked references like Derek mentioned.
If you haven't already, verify in VB Editor that you have the same libraries and references added. We frequently see where, after upgrading, VB Editor won't have the libraries/referenced added that it had at the previous version, causing errors such as this.
Otherwise, other than the error 424 seems to imply 'object not found', I didn't find anything much more as to this error message, though I imagine our community developers may have seen this type of message and can assist....
Thanks
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156