UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Error 459 On Subform Record Check, Access 2016    
 
   
JAchord
post Jan 8 2020, 12:11 PM
Post#1



Posts: 155
Joined: 11-July 14



I have a code to check if a subform has values. It was working fine then access crashed now I get a 459 error. C&R does not fix it. Any thoughts? See the code for the two methods that I have tried. The one commented out is the original. And yes the subform populates as expected.

CODE
On Error GoTo IBExcellExportBTN_Click_Err
    If Me.AccountEquipmentsbfrm.Form.Count > 0 Then
    'If Me.AccountEquipmentsbfrm.Form.Recordset.RecordCount > 0 Then
        DoCmd.OutputTo acOutputQuery, "CurrentDataExportqry", acFormatXLS, Me.custName.Value & " Installation Report.xls", True
    Else
        MsgBox "No records found to export."
    End If


IBExcellExportBTN_Click_Exit:
    Exit Sub

IBExcellExportBTN_Click_Err:
    MsgBox Error$
    Resume IBExcellExportBTN_Click_Exit
Go to the top of the page
 
theDBguy
post Jan 8 2020, 12:19 PM
Post#2


UA Moderator
Posts: 77,304
Joined: 19-June 07
From: SunnySandyEggo


Hi. Just curious, what is error 459?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
June7
post Jan 8 2020, 12:23 PM
Post#3



Posts: 1,153
Joined: 25-January 16
From: The Great Land


What is exact error message?

Shouldn't you specify destination folder path?

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 
JAchord
post Jan 8 2020, 12:38 PM
Post#4



Posts: 155
Joined: 11-July 14



Runtime Error 459 Object or class does not support the class of events
Go to the top of the page
 
JAchord
post Jan 8 2020, 12:58 PM
Post#5



Posts: 155
Joined: 11-July 14



Its giving me the error and highlighting either of the following lines depending on which I try. Access stopped responding because of a query that got hung up.

CODE
If Me.AccountEquipmentsbfrm.Form.Count > 0 Then
    'If Me.AccountEquipmentsbfrm.Form.Recordset.RecordCount > 0 Then


If you do not specify where to save it, it defalts to the "documents" folder on the local HD.
Go to the top of the page
 
JAchord
post Jan 8 2020, 02:07 PM
Post#6



Posts: 155
Joined: 11-July 14



Well still do not know what caused it. However I did fix it. I copied the subform. Renamed the original and used the original name on the copy. Started working again. Thanks for the input.
Go to the top of the page
 
theDBguy
post Jan 8 2020, 02:18 PM
Post#7


UA Moderator
Posts: 77,304
Joined: 19-June 07
From: SunnySandyEggo


Hi. Glad to hear you got it sorted out. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
June7
post Jan 8 2020, 07:55 PM
Post#8



Posts: 1,153
Joined: 25-January 16
From: The Great Land


When I didn't specify destination, file saved into a working folder where I save files downloaded from forum, not Documents folder.

This post has been edited by June7: Jan 8 2020, 07:55 PM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 
JAchord
post Jan 9 2020, 12:33 PM
Post#9



Posts: 155
Joined: 11-July 14



June I think it depends on what the default in windows or possibly access is set to. I know if I try to export a query using the export tool and not vba. The screen always pops up with the documents folder already entered. I can change it then if I want but never do. Honestly I would prefer that it didn't save a copy. Just open the spread sheet and let the user save a copy if and where they want to.
Go to the top of the page
 
June7
post Jan 9 2020, 08:04 PM
Post#10



Posts: 1,153
Joined: 25-January 16
From: The Great Land


Which is why I asked if destination path should be explicitly specified, to be certain where it ends up.


--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th January 2020 - 08:56 PM