HELP! 
Author Message
 HELP!

Here's the situation:
        I have a master form connecting about 10 different databases.  This
contains information on customers, contacts, etc.  I want to have a button on
the page of the form which has the company name on it.  I want this button to
then pull up a table and graph of that company's revenue.  I have tried 2
different things - created a new form from a query and linked that form to
the button, but this brings up all the companies, not that specific one.  
This also lumps together all the companies revenue together.  I also tried
embedding the query into the button, but no luck there either.  I think I
need to use a TCursor or something to point to the company name field on the
master form then bring that over into the query to pull up only that company
- I just don't know how!!! Any suggestions would be great!

TIM



Thu, 23 Jul 1998 03:00:00 GMT
 HELP!

Quote:

>Here's the situation:
>    I have a master form connecting about 10 different databases.  This
>contains information on customers, contacts, etc.  I want to have a button on
>the page of the form which has the company name on it.  I want this button to
>then pull up a table and graph of that company's revenue.  I have tried 2
>different things - created a new form from a query and linked that form to
>the button, but this brings up all the companies, not that specific one.
>This also lumps together all the companies revenue together.  I also tried
>embedding the query into the button, but no luck there either.  I think I
>need to use a TCursor or something to point to the company name field on the
>master form then bring that over into the query to pull up only that company
>- I just don't know how!!! Any suggestions would be great!

>TIM


You can do what you want using a query.  Your objectPAL method will look something
like this:
method pushButton(...)
var
   companyName  String
   q  Query
endvar
   companyName = Company_Name.value

   q=Query

     aTable | Company Name | Revenue |
            | ~companyName | check <or whatever> |
etc.

   endQuery

   q.executeQBE()

The answer table will now hold only the values for the company you want; you
can create your graph based on the answer table (or add the records to a permanent
table, or however you are implementing this).

Hope this helps.

Jim



Fri, 24 Jul 1998 03:00:00 GMT
 HELP!
Quote:

> Here's the situation:
>         I have a master form connecting about 10 different databases.  This
> contains information on customers, contacts, etc.  I want to have a button on
> the page of the form which has the company name on it.  I want this button to
> then pull up a table and graph of that company's revenue.  I have tried 2
> different things - created a new form from a query and linked that form to
> the button, but this brings up all the companies, not that specific one.
> This also lumps together all the companies revenue together.  I also tried
> embedding the query into the button, but no luck there either.  I think I
> need to use a TCursor or something to point to the company name field on the
> master form then bring that over into the query to pull up only that company
> - I just don't know how!!! Any suggestions would be great!

  Design your form with a master-->detail data model, in which the company
table is the master and the details have the revenue.  On the form put a single
field with the company's id (field name CID).  Put a tableframe with your detail data.
I will assume that the company table has a field "ID" which contains the company
unique identifier.

  In the pushbutton method on your calling form, do something like

   var
    f form
    selectedCompany {whatever type your company ID is}
   endvar

    ; we will keep the form open, but hidden so it comes up faster
    ; on subsequent tries.  You should close it when the calling form closes.      

    selectedCompany = { Whatever you have to do to get the ID for the
                        company you want to look at.  Perhaps a dmget,
                        perhaps it is already a field visible on a table}

    if selectedCompany.isblank() then
      msgInfo("Oops","You need to select a company first")
      return
    endif

    if not f.attach( "Company Revenues" )  
     then
       f.open("mynewform.fsl",WinStyleHidden)
       f.settitle( "Company Revenues" )
    endif
    f.CID.locate( "ID", selectedCompany )
    f.bringToTop()
    f.wait()
    f.hide()

  In the close() method of your button, put

    while f.attach( "Company Revenues" )
      f.close()
    endwhile

I am away from my PC now, but I hope this helps.

--

Coupled Climate Dynamics Group/971            
NASA Goddard Space Flight Center              
Greenbelt, MD 20771



Fri, 24 Jul 1998 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. help,help,help,help,help,help,help,help,help,help,help,help,help,

2. Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,

3. help help help help help help help help help

4. SQL To ORACLE Help Help Help Help Help

5. query:HELP! HELP HELP HELP HELP

6. Help help help help

7. HELP HELP HELP HELP!

8. HELP HELP HELP HELP

9. HELP HELP HELP

10. Refresh Test Environment help help help

11. backup HELP HELP HELP

12. HELP HELP HELP!!!!


 
Powered by phpBB® Forum Software