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

Display Number of Invoices for a Customer

Status
Not open for further replies.

jlucio

Programmer
Mar 20, 2001
13
MX
Hi!. I Know somebody can helpme.
In an aplication, I must show how many invoices has each customer in a Customer Form. There are Customer.DBF (Parent) and Invoices.DBF (Child). The problem is that I must count number of invoices for customer as the operator click in Next, Previous, etc. Which property of Form can I Use to do a simple scan to count?
Thank You in advice
 
In the click event of your commandgroup (not each bottoms) call a function you would have previously created in the form.
Assuming your count is shown on the form in a textbox;

in the click event:

Code:
thisform.textcount.value=;
thisform.countmyinvoice(thisform.customernumber)

And star your function with a paramater

Code:
LPARAMETER lcCustno
local count1
SELECT custnumber FROM customer into cursor myCount
COUNT TO count1
RETURN count1
 
mgagnon:
Thanks for the tip. However, all works fine when I tried in the InteractiveChange event of the commandgroup, not in de click envent. The last doesn´t seem to work
jlucio
 
The commandgroup's contained Button's Click event would be a place to put the form method call; the CommandGroup's InteractiveChange works, too, because it fires when any contained button is clicked.
 
jlucio,

Sorry, I hadn't tested it, but I'm glad you were able to work it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top