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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp9 - vanishing combo box on finished app?

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,334
FR
Hi All,

I have a compiled app, it's been working fine.

Recently I have been adding a bit of functionality and one if the new forms (for adding records) has a combo box on it.

The source of the combo is a select statement into a cursor.

Most of the time it all works fine. Then, after some use, the combo fails to appear on the form when it's opened.

To get it back, the users have been quitting the app and going back into it (they worked that out on their own - one up to them!).

There is no code to make it not visible and there is another combo on the same form, sourced from a select statement into a cursor in the same way...

Why does it vanish?

The form isn't loaded a lot of times - they have only added about 50 records using the form, on two machines - so on average the problem must occur after about 10 uses of the form?

It's not happened on the development and test machines at all - only on the customers site.

Help

I have stuck a routine to make it invisible and the visible on form activate now - but I won't get feedback before Monday.

TIA

Regards

Griff
Keep [Smile]ing
 
Possibly a Themes problem?
Do you have the Themes property set to .T. on the form?
If so try setting it to .F.

I couldn't think of any other reason...

Rob.
 
Hi Rob,

I've never looked at themes, thanks for the thought.

I wondered if it were a memory thing?

Thanks again

Regards

Griff
Keep [Smile]ing
 
Griff,
It doesn't sound like a memory issue... if it were I don't think it would be so specifically selective to that one combo box... (Just don't want you chasing down a long path that will waste time).
Can't think of anything else at this point... have never had a similar situation myself. Maybe you can stick a routine in that captures the state of variables on the form for a period of time, to collect it, and then analyze when/how it's happening. (And if the object is indeed getting set This.Visible = .F.) or some other odd behavior.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I don't think there were any visible=.f. in any of the code, but you never know...

I've put some in deliberately now, so I'll wait for feedback on Monday.

Thanks for your thoughts

Martin

Regards

Griff
Keep [Smile]ing
 
Just one other thought about what you said above, "I don't think there were any visible=.f."... I find usually that when that kind of thing happens to me (weird behaviors) it's usually something that has been inherited from somewhere else, and is out of my main thought process... just a thought, to check out the inherited bits...


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Martin,

This is really weird, isn't it?

I'd normally suggest setting a breakpoint on the combo box's Visible property. But you mentioned that this only happens at the client's site, so obviously that's not an option.

Is the combo box based on a custom class? If so, I wonder if it's worth creating an assign method on the visible property of the class. In the assign method, check to see if the property in changing from .T. to .F. If it is, maybe dump the call stack (using ASTACKINFO()) to a text file.

It's a bit of a long shot. It might be nothing to do with the Visible property -- maybe some other object is obscuring the control. In any case, I'm not sure if ASTACKINFO() works in an assign method.

Just a thought.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike

The combo is just a bog standard one - out of the box VFP.

I'm running SP1 of VFP9, and so is the clients machine.

I don't 'think' anything is obscuring it, and as it forms part of the validation for the form (i.e. it has to be competed) I've given it a default value...

We'll see what Monday brings.

I can perhaps use VNC to one of the machines and see if I can replicate the problem.

Ta again

Regards

Griff
Keep [Smile]ing
 
If it's failing to appear on form open, I'd be suspicious that something in the Init of the combo is returning .F.

Tamar
 
Hi Tamar

It doesn't fail to appear every time, just once in a while.

The init for the form has (had) no visible=.f. and
there is only the default method for init'ing the combo itself.

At the moment I'm using additional code to make it visible in the activate code - and I have heard nothing today from the users.

Thanks for the thought

Regards

Griff
Keep [Smile]ing
 
If it only happens sometimes it could be a timing issue. Sometimes issuing a brief sleep at the right point makes them go away.

Is the data behind the cursor on a network drive?

Brian
 
Griff,
Just a thought, since it is a combo box, why not make your source an Array instead of a combo? Add an property to the control (like SourceArray). Then set your source to This.SourceArray. You can load the array with:

This.SourceArray = '-None-'

SELECT DISTINCT FROM <your table> INTO ARRAY This.SourceArray

If it is the cursor that is causing the problem, this should be just as good, and probably faster, especially if you only have a few items in the combo box anyway...



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Brian,

I *think* that you might have the answer there, the end-users have a M$ network that does sometimes take a bit of time to return results - it *can* take a while to open a mapped drive in explorer for example.

So, *maybe* this one is just being hyper sensitive...

I've not heard any new complaints yet - I'll report back when I speak to site later.

Maniac I've never done it that way before - I'll have a look at that.

Thanks all



Regards

Griff
Keep [Smile]ing
 
Just spoke to a user, he says it's still happening.

It's not causing a major problem, he's working around it by adding the order (letting the default value in the invisible combo stand) and then editing it if needed.

So, off to look at timing I guess...

Martin

Regards

Griff
Keep [Smile]ing
 
Griff,
I actually handle my combo boxes exclusively this way... It allows me to keep the data source seperate from the storage value, and I only have to create them once or refresh them if need be. I have a class I can give you if you like, and can explain how it works. It's not complicated, and has lovely functionality that my users love.
If you're intersted I can e-mail it to you.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott,

I will give your approach a go - after business finishes, don't want to update the users during the day if I can help it.

I follow the reasoning, and think it might work for this one.

I'll pass on the custom-class for the time being (I don't use them as a rule - some mental block on my part!).

Thanks

Regards

Griff
Keep [Smile]ing
 
Griff,
Not so much a "custom-class". I use the VFP COMBOBOX as the base class, and have added a couple properties, and some code in the methods. Just keeps me from having to redo it every time... you should consider sub-classing the base VFP controls though, to take advantage of inheritance. Will make your development life MUCH faster and easier.
If you need any insite, let me know. I found the base ComboClass as included in VFP exceedingly inadequte in terms of how it worked (at least back in VFP6 when I started). I recently noticed an "Auto Complete" property in the data tab of a textbox level... not sure if it does what I have my Combo doing, but I have my combo box actually functioning as a REAL Combo Box (It allows selection from either the drop down, or "Auto-Complete" feature that I've built in, or direct entry for new items.) It populates initially via a select statement, and updates via array if a new element is added.

Anyway, good luck. Let me know if you run into anything.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Interesting update...

I was visiting the users site today, and on one of the two machines exhibiting the problem something else was happening as well.

On loading the application they kept getting an error message saying that they couldn't find the entry point for the ntdll.dll - the user hadn't bothered to mention it before...

And he says it's stopped disappearing on his machine now, his colleague is on holiday - perhaps it is all a mirage!


Regards

Griff
Keep [Smile]ing
 
Don't you just love users... I once had a user that I asked him to reset his computer. He said he did, and nothing changed. I went down stairs, and he had turned the monitor off and back on again... Honestly, how do some people function in society???


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top