Unanswered: Paradox code to open table for export within push button on form
I want to export information from a query that requests a begin and end date from within a form push button so the user can export the results to Excel for data analysis and charting. I don't know how to run the query and leave the answer table open for the user. I also plan to save the table to another name but wanted to keep it simple until I solve the open problem.
I inherited Paradox from a deceased developer a few years ago and we are no longer developing in Paradox but still running this legacy application. I only get into this Paradox app when something is broken or they seriously need data. Thus, the need to send the data to Excel. I thought I could reuse the code for a parameter report where the user enters a date range and the report spits out for them. This user is so naive, she messes up the query when she enters dates, so I'm trying to make it as easy as possible for her. I'm not even sure if she will be capable of the export, but I thought I might be able to automate that within Excel for her.
Here's the code I have - anything better is welcome.
method pushButton(var eventInfo Event)
tblName = ":PRIV:ANSWER.DB"
yesVar = msgQuestion("Performance Query",
"Do you want to continue with query by date range?")
case yesVar = "Yes" :
fSt = "For example: 1/1/09"
fDt = today()
lSt = "For example: 12/31/09"
lDt = today()
fSt.view("Enter first date of query like 01/01/09")
if fSt <> "For example: 01/01/09" then
fDt = date(fSt)
lSt.view("Enter Last date of query like 12/31/09")
if lSt <> "For example: 12/31/09" then
lDt = date(lSt)
qryName = Query
EAP_NAME.DB | Last Name, First MI |
| join1 |
EAP_NAME.DB | Contact Date | Chart # |
| Check _join2 | Check | Check |
EAP_DATE.DB | Last Name, First MI |Contact Date |
| join1 | Check _join2 | >=~fDt, =~lDt |
if executeQBE(qryName, tblName) then
if isTable(tblName) then
if NOT tblVar.isEmpty() then
case yesVar = "No" :
not really knowing your overall OPAL knowledge or capabilities, my first suggestion would be to check Dateval() of the user's response.. then, after both inputs, make sure the second one is a later date than the first one..
Steven Green - Myrtle Beach, South Carolina USA