Hi all
Another problem with a list box.
Form has a list box, an edit box and a number of buttons.
In the init of the form I navigate to the folder that holds all the
clients queries. It then automatically populates the list box with the
names of the queries.
DoDefault()
Public Array aFolder[1]
Local lcDefault
lcDefault = Set("Default")
lcQprPath = oGlobal.cQueryPath && Global array of variables populated in
the main prog.
Set Default To &lcQprPath
ADir(AFolder,"*.qpr")
Set Default To &lcDefault
That works fine list has all the QPR's and they can be selected.
Buttons work to "Open" the QPR and display it in the edit box.
An "Edit" box to all minor changes to the SQL.
A "Run" button which runs the Query.
A "Save" button which gets enabled if the SQL is changed.
Also a right click button which does all of those plus a "Delete"
option.
In design mode it all works. Click save and a new query is save with
the name of the old one with the addition of an incrementing number.
E.G. Areas.qpr, Areas1.qpr, Areas3.qpr etc.
Select a qpr, right click and select delete and the qpr is deleted. In
both cases the list box is refreshed and shows the new file or removes
the deleted file name.
Using the compiled exe the list box clears and just show .f.
The code of the delete function is
lcDefault = Set("Default")
lcPath = oGlobal.cQueryPath
Set Default To &lcPath
lcFile =
Lower(Alltrim(ThisForm.List1.ListItem(ThisForm.List1.ListItemId)))
lcFile2 = Strtran(lcFile,"qpr","") + "qpx"
lnAnswer = MsgBox("Are you sure you want to delete " +
lcFile,"\<Yes;\<No","File deletion",5)
If lnAnswer = 1
If File(lcFile)
Erase (lcFile)
Erase (lcFile2)
EndIf
EndIf
Set Default To &lcDefault
Release aFolder
Public Array aFolder[1]
ADir(AFolder,"*.qpr")
ThisForm.List1.Requery()
Any ideas.
Cheers
Peter
Peter Hart Computers
UK members
I have a number of new toner cartridges and ink cartridges which are
supplies to requirement available at the cost of postage if anyone is
interested.
I will supply a list if so.
I also have a large number of second hand components, printers,
monitors, computers, cables etc. available.
Anyone interested would have to come and rummage through the store and
take what they could use.
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/a57fa4cf19531343a2ee11b57db8e3af100...@server.peterhartcomputers.local
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.