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

Weird ListBox Issue

Status
Not open for further replies.

crewchiefpro6

Programmer
Mar 22, 2005
204
US
I have a listbox control on my form that is behaving badly. Whenever there is any code in the INTERACTIVE CHANGE event the cursor cannot be moved without it jumping back to the last record in the list.

The code in init of the form sets the tag order on the list.

The interactive change code was simply THISFORM.REFRESH()

If I take out the code it works fine but does not refresh when I choose a different record.

There is no other code controlling this list. What stupid thing did I do wrong.

By the way, if you have a cat do not forget to make the keyboard inaccessable to it. I came down today to find 200 pages of text with xgfd characters repeated endlessly. My cat sat on my keyboard and watched the birds.

Just a helpful note from your Uncle Don.


Don Higgins
 
The interactive change code was simply THISFORM.REFRESH()
As you know, that'll call the refresh for everything on the form. Have you tried single-stepping to see exactly what it is calling?

Coincidentally I was just looking at the BitBoost site for details of some international address formats. You might to look at for your other problem.

Geoff Franklin
 
Hi Don.

The interactive change code was simply THISFORM.REFRESH()

Then I am not surprised that the Listbox kept junping back to the previous value. The controlSource of the control is updated when the InteractiveChange() method completes. Since Refresh() updates the control's value from its ControlSource, all you were doing was restoring the control's value to what it was previously.

If I take out the code it works fine but does not refresh when I choose a different record.

What do you mean by that? Choose a different record from where?



Marcia G. Akins
 

Geoff,

Where on the BitBoost site is there any information about international address formats? All I can see, apart from PawSense, is something about teaching katakan, and their PosterMaze product.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks Geoff, that is much cheaper than having to buy a collar that zaps them when they get near the computer!

Marcia, when I chose a different record in the list, either by clicking on it or moving the highlighted cell with the mouse.



Don Higgins
 
From Marcia:
>>>>>>>>
Then I am not surprised that the Listbox kept junping back to the previous value. The controlSource of the control is updated when the InteractiveChange() method completes. Since Refresh() updates the control's value from its ControlSource, all you were doing was restoring the control's value to what it was previously.
<<<<

So how do I use the listbox to select a record, refresh the rest of the controls and keep the value in the listbox from changing?



Don Higgins
 
Hi Don.

Marcia, when I chose a different record in the list, either by clicking on it or moving the highlighted cell with the mouse.

If you are using the ListBox to select a record, then you do not need to refresh() the ListBox - it's Value will be whatever you selected and should not change unless you do something ( either in code or interactively ) to change it.


So how do I use the listbox to select a record, refresh the rest of the controls and keep the value in the listbox from changing?

Put a Thisform.Refresh() in the ListBox's Valid()





Marcia G. Akins
 
>> Put a Thisform.Refresh() in the ListBox's Valid()

I still have something going on in this form. I had the listbox valid with this code and while it will refresh the form, the listbox still goes down to the last record in the list.

What I was trying to recreate was my old Fox 2.6 program that dealers liked because as soon as they moved the highlight in the listbox it would refresh the controls. I used a WHEN clause then to seek a record and then executed a show gets.

I am going to scrap this and start over. The debugger shows nothing going on but yet the highlight is moved without my help.



Don Higgins
 
In frustration I created another form, then added the controls by copying an pasting to the new form and it works fine.

It is no wonder why I like to race. I would rather die in a racecar then kill myself programming.



Don Higgins
 
What I was trying to recreate was my old Fox 2.6 program that dealers liked because as soon as they moved the highlight in the listbox it would refresh the controls. I used a WHEN clause then to seek a record and then executed a show gets.

If the RowSourceType of the ListBox is 2-Alias or 6-Fields, selecting an item in the list moves the record pointer in the associated alias.

Issuing a Thisform.Refresh() in the ListBox's Valid is all you need to update the controls on the form that are bound to that alias.



Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top