How can I get rid of a persistent VBA Form Object that won't honor the form deletion? - forms

I have an MS Access 2003 database that I'm using to develop a basic little inventory app. I have added some extraneous forms along the way and I wanted to get them out of the DB. I deleted most of them just fine but one of them appears to have left behind its VBA Object. All that's in the object is Option Compare Database. Now whenever I try to work with the database, I get the following error:
The form name 'Transaction1' is misspelled or refers to a form that doesn't exist.
If the invalid form name is a macro, ...
Truncated for typings sake.
Yes, I agree, the form doesn't exist. What confuses me so much is that all of the other forms, when I deleted them, also destroyed their VBA object as well. This one, no matter what, seems to like to stick around and I have no idea how to get rid of it.
How do I get rid of it?
Things I've tried:
Compact and Repair and the DB
Create a new form named what it's expecting, verify that it gets rid of the problem, and then delete that form.

You can try the /decompile switch
Make a backup of your mdb
Open your mdb (hold the SHIFT key down to stop any code from running) via a short
cut: msaccess.exe database.mdb /decompile
Open a module and compile your app
Save and close Access
Open again (SHIFT again) without decompile
Compact and repair database
close Access

I had similar problem. I found I had named the missing form in the STARTUP menu as the default form to open when starting Access. I opened Tools>Startup and deleted the missing forms name from the "Display/Form/Page" field of the Startup. My problem solved.

The problem I was having is that the form was named ~TMPCLP8151 and would not show up in Access no matter what I tried, but I could see it in VBA in the Project Explorer. Here's how I resolved the issue. I created a new form, and created an Event Procedure for Form_Open that contained this:
DoCmd.DeleteObject acForm, "~TMPCLP8151"
Then I just opened the form, and sure enough, the VB code deleted the form that I could not delete myself.

I had a same problem. I created a form with same name and deleted the form again. That fixed the peoblem. Try. BTW try to open the new form in design mode to make sure if the VBA module is assosiated with the new form.

I had to combine both solutions to achieve the goal.
First de- and recompile
next compact and repair
then create new form with the same name and delete it
Pay attention that the form has the status Hasmodule set to Yes

I had this problem. I renamed my default form from Form Login to frmLogin which suits my naming style, but the program was still looking for it on opening. I am using 2013 so I went to File » Options » CurrentDB and in the display dropdown select the new name. The old name remains in the list until you close and restart the application.

Related

Opening the VSC settings window from code

I'm working on a Visual Studio Code extension, where some settings are required for it to work properly. Right now, in case the user has forgotten something, I'm showing a warning message indicating this, and telling them to fix this property in the settings. I would, however, like to add a button that opens the settings page of that property.
However, after looking around for over an hour, I can't seem to find any support for this in the Api, or anyone else asking this question (which I find a bit weird?). If it really doesn't exist, I'd still expect at least 1 other person asking this somewhere, but as far as I can see there's absolutely nothing.
Is it possible to open the settings window (preferably even filtering them down to only my extension's properties/the one property that has to be filled in) from code?
Thanks in advance
I found it out myself after digging through the keybinds window. You can use the following to open the settings:
vscode.commands.executeCommand("workbench.action.openSettings2");
I did not, however, find how to pass a search query into it to open a specific place in the settings.
EDIT: You can use openSettings & add the search query as an extra argument to executeCommand. For example - if your property is defined as my.extension.property in package.json, you can use this:
vscode.commands.executeCommand("workbench.action.openSettings", "my.extension.property");

Visual Foxpro exe file not working

I am beginner in using Visual FoxPro. I am trying to create a simple application which contains a form with a few textboxes. The problem is that the application window does not appear when I run the executable file which I build.
The code for the program is:
PROCEDURE main_app
_SCREEN.Activate
_SCREEN.WindowState = 2
_SCREEN.backcolor = RGB(128, 128, ;
128)
_SCREEN.Caption = ""
_SCREEN.refresh()
SET TALK OFF
SET DELETED ON
SET EXCLUSIVE OFF
CLEAR ALL
CLEAR
CLOSE ALL
DO FORM simpleform LINKED
READ EVENTS
RETURN
*MESSAGEBOX('Msg')
ENDPROC
In the form I have a few textboxes and a button. When the button is clicked then some code is executed. If I run the application from the IDE everything works fine but if I create the executable this does not display any window, still the process appears in the task manager. If I uncomment the MessageBox then this will appear even if I run the exe file. I don't know a way to trace the problem outside the IDE, maybe there is still a library needed that I am not aware.
I am using Visual FoxPro 9.0
Would someone be able to help me out?
If you can provide me with a link to a very simple application exe which uses just one form and finishes when the form is closed I would very much appreciate it.
Thanks in advance
I tried creating a brand new project, new code and new form just as you described. I copied your code and ran, but it never displayed the form.
If this is the main app in your project, you don't need the initial
PROCEDURE main_app
just remove this line as there is nothing CALLING the "Main_App" and thus is never getting called to ultimately call your form.
Just comment it out, save your project and run it... See what you get, it SHOULD work.
** PROCEDURE main_app
The problem was that I did not set the screen visibility to true.

Unable to delete content resources on JasperReports Server

I'm using JasperReports Server 5.6 and I have some reports deployed there.
The problem starts when I generate a PDF output for my reports. I can see the output file in the repository, but I'm unable to delete it.
I'm able to delete other types of resources, as an image or report, for example. But when I need to delete a generated PDF, the upper options bar doesn't offer me any options (including deleting). If I try to right-click the PDF, it doesn't open any pop-up menus (as it does for images, for example).
The image below shows what happens to the options bar:
Here goes some interesting things I've noticed:
The type column in the repo tells me the PDF is a "Content Resource". If I manually upload another PDF from my local machine to the repo as a "Content Resource", the UI also doesn't let me delete the resource.
I'm logged in as the administrator user. It's set with ROLE_USER and ROLE_ADMINISTRATOR roles (it's the default jasperadmin user).
The directory which contains the PDF is set with permissions Read+Write+Delete for the ROLE_USER.
Tried to log in as another user with ROLE_USER and I got the same result.
The JasperReports Server's tomcat is running as root (it's a test environment).
I went through the JasperReports Server's User's Guide and Administrator's Guide. Both said that I need to have the right permissions (and I do), and also I need to have no references to the resources to be deleted. In the case above, where I have an uploaded PDF as a "Content Resource", I don't have any references to it inside the repo, and I still can't delete it!
If I delete the super directory that contains the PDF, it works fine.
So, do you guys have any ideas of what I can try to get rid of these PDF outputs?
So far the best solution, I didn't find any better, for this is to use the delete button on the keyboard
I really don't know why is the menu button disabled but nevermind.
I am facing the same problem. There is a work around for this: Use Jaspersoft Studio.
Add a JasperReports Server Connection, expand the node and locate the file you wanted, then right-click and select Delete.
This is not an elegance solution but works for the moment.
EDIT - found the problem and have a fix.
The JS is missing "Utils" scope in getInitConfiguration. The original source is:
var Utils = {
restOfString: function(str, fromStr) {
var from = str.lastIndexOf(fromStr) + fromStr.length;
return str.substring(from, str.length).trim();
},
getInitOptions: function () {
return localContext.rsInitOptions || __jrsConfigs__.repositorySearch["localContext"].rsInitOptions;
},
getInitConfiguration: function () {
return getInitOptions().configuration;
}
};
Just change "return getInitOptions().configuration;" to get "return Utils.getInitOptions().configuration;"
You'll have to make this change in the optimized version of the script (optimized-scripts/results.page.js). Fortunately there are only two occurrences of getInitOptions so it's easy to find and fix the correct one.
The root cause is a javascript error:
uncaught ReferenceError: getInitOptions is not defined
This is coming from results.page.js, but I haven't found a fix for it yet. This code is attempting to change the state of the toolbar buttons. I tried using the latest 6.x version of the script, and that did not fix the problem either.
Also listed at http://community.jaspersoft.com/questions/843951/unable-delete-report-output-jasperserver-56
When you are going to delete the content resource Delete button show disable. I am also experiencing the same problem so for time being I am deleting my content resources by using following query on Jasperserver schema.
Delete from jicontentresource where id in
(
Select id from jiresource
where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25');
Delete from jiresource where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25';
You have only to mark all files and then push the Delete-Button

Access 2010 Form.Repaint - Hanging

I'm hopefully missing something obvious here...
I have just kicked off developing a new Access 2010 application. Something personal and hopefully simple.
The first thing I need to do is read a bunch of files off of the hard drive. I parse the contents adding the information to a table if it doesn't already exist.
Code works fine, that's not the issue. As it can take a while I've added a simple progress dialog using a standard form but in dialog/popup mode. As the For Each loop of the FSO.Folder.Files object is progressed I send some information to a couple of text boxes and issue a Me.Repaint (have also tried DoCmd.RepaintObject acForm, "FormName").
The issue is that I can get anywhere from 5% to 35% of the process complete before the repaints stop responding. The form only repaints when it gets to 100%.
The process uses limited recursion - if there is a subfolder - it calls itself to process that subfolder, but the folder structure is fairly linear so not many of those.
There are nothing bound to the form. All table updates happen in code and via RecordSets.
Any ideas why Access stops responding?
Cheers,
Roy
Add DoEvents after Repaint. That will cause Access to yield to Windows, which will can then handle its pending tasks ... such as updating the display in this case.
Actually, if your code updates text boxes, I don't see why you need to Repaint the form in order to display the changes. Try something like this instead ...
Me.MyTextBox = "hello"
DoEvents

Prevent closing the Application if file not saved

We have an application based on Eclipse-RCP. The problem I am trying to fix is as follows:
Say the user has an unsaved model file, and tries to close the application. The application rightly prompts the user for options to Save the file, Ignore it, or Cancel closing the application. Ignore and cancel are no-brainers. If the user decides to save the file, there is another dialog box that gives the user an option to either save the file or cancel the save (its a custom editor, similar to a Save-As dialog).
Now, the question:
How do I prevent killing the application when the user selects "Yes" in the first prompt, but cancels the save in the second? I thought of looking up the base class of the application, but couldn't find it. Or should I be looking at the custom-editor for the model file?
Thanks in advance, any help is appreciated...
If you are in RCP you have the luxury of returning false from WorkbenchAdvisor.preShutdown()
Let a workbench part holding the model implement org.eclipse.ui.ISaveablePart2 interface meant for cases like yours.