Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cmd button on a form doesn't always work.

Status
Not open for further replies.

Bryan - Gendev

Programmer
Jan 9, 2011
408
AU
This has me stumped (again).

My application has moved to version 9. My backup of V8 failed behind my back and I needed to rewrite a whole lot of code and forms.

However that's now done but this strange problem has me beaten.

Within my app is a simple form with a cmd button.
When clicked it runs a code prg.

This works on my PCs but I have two users who get no response when they click the button.
I've tried adding the prg code directly to the click event instead of the DO prgfile command.

Both ways work fine for me here but that did not solve the problem for my users. Their log file shows no action at all when cmd button is clicked.

There are many many cmd buttons within my app but this is the only one that is causing any trouble as far as I know. As it works here I can't test the problem.

Has anyone come across this before and found a solution?

Thanks

GenDev
 
Hi GenDev,

You say you have two users who are seeing this problem. Do you also have other users (other than yourself) who do not see the problem?

If so, there must be something different in the setup of those two users compared to the others. Have you any idea what that difference could be? Is it possible that they have a different version of the executable, for example?

Also, what exactly happens when those two users click the button? Does the button appear depressed while the click is in progress, or does it appear disabled? If the former, are you sure the code isn't running? In other words, is it possible that the problem lies, not in the button, but in the code itself?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike

U said
>If so, there must be something different in the setup of those two users compared to the others. Have you any idea what that difference could be?

This is the problem exactly - they both run our Genealogy Software but probably have many many other apps installed.

Is it possible that they have a different version of the executable, for example? No - sent them both the same exe.

Have asked them to answer your question re clicking on the button.....

Thanks as always

GenDev
 
Mike,

The response of one of the users is

At the Exhibit Checker screen, the button titled, "Select Exhibit Folder" appears to have the focus. It is lightly outlined in dashes as most buttons are when they have the focus. When I click it however, that entire screen disappears, as if I had clicked the "Close" button. The screen simply closes and disappears so rapidly there is no chance to see anything happen to the button. The click and close are instantaneous, and I am back to the previous screen.

I can't think what is happening here - do you Mike?

GenDev
 
Sorry, GenDev, but it's really difficult to solve this kind of problem without actually running the form in the debugger.

The best I can suggest is that you create a special test version of the app for these two users. Take out all the code from the button's Click method. Replace it with a simple messagebox or Wait window. See if that works. If it does, start adding back your actual code, a little at a time. Each time, have the user test it, until the problem eventually reappears. That will at least give you a clue as to whether it's your code that's causing the problem, and, if so, roughly where in the code it happens.

Apart from that, I don't know what to suggest. Maybe someone else has got some bright ideas?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I can suggestest again what I suggested a few times lately: Add COVERAGE to the code to see what happens. The behaviour the user describes looks like an error occurs somewhere and exits the whole process.

To see which lines of click run COVERAGE would be a help.
It simply takes one line: SET COVERAGE TO D:\coverage.log at the begin of the click event, perhaps. Or at the end of form.init(). Once the process crashes this log file should become readable and a user can send it to you.

You can additionally add MESSAGEBOX() calls to sectioons of the click code or called prg to see how far it goes without exiting. It could turn out as simple as a misconfiguration of database, DBF missing or anything letting the code crash.

Bye, Olaf.
 
This sounds like a problem I've seen reported many times. In forms created in older versions, some controls stop accepting mouse clicks. It's usually a control inside a container, though.

Can your clients navigate to the commandbutton with the keyboard and press enter?
 
My apologies to everyone.

My addition of the code to the button did actually solve the problem but I did make an error when I first did it.

Thanks

GenDev

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top