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!

Form getting data in table

Status
Not open for further replies.

ggreg

Programmer
Mar 9, 2001
201
US
I have made a calcuated field in a table field name of
a form. The form show the right information but data does
not fill in the table, also I can not get this same build
statement to work as a expression in a query either.
I am a Access person trying to learn FoxPro!
can someone walk me thru what i am not doing in properties
box??
 
Sorry I cannot understand the question properly :)

1. If you want a way to sum a field in a table - use the SUM command with filter conditions.
2. To display the total in the form, the appropriate object need to get the value.
In the refresh form command, provide this SUM command.
Get the form refresh at appropriate places by using ThisForm.Refresh() in the valid or lost focus event of the object which changes the value.
Hope this helps you. If you need more in detail .. please ask for help by reposting clearly.

 
ramani,
maybe thats why I did not get many people respond to my question,
too a big part of my problem is I know Access but am learning
Foxpro and dont have any books to learn from yet.

I realize in a database a person 99% of the time does not store a calculation in a table
my database is to track a nascar game that i am playing in a local newspaper.

In the form and a table I have a field call points,and one call finish. Finish is
where the driver finish in a race. Now points is the points the newspaper assign
to a drive place. Which is simply 43-finish+1....now in the form, which i use for input
to the table, I can get the form to calculate and show me the points but where the
car #, race, and finish transfer to the table on input points does not tranfers to
the table, now in the property box control field is where i place the calculation,
but what other things do i need to do in the property box to get that data to go into
the table........... I have also try doing a build statement in the table but dont know
where or how in the table to get it to work there.

Do you understand now or do you need more information....
how about anybody???can anybody help me out now??

Thanks all!




 
The catch is... the place where you store your calculation.
You are storing the calculation in the control field which will never be written to the table. Instead get the value stored in the controls value where as the control is the table field where it shall be written...
... huh.. my writings seems cryptic..

Hope you got the catch ! :)

You can store the value to the control field thru' the valid event firing of the finish entry
under the property sheet of 'finish' control... valid event...
ThisForm.txtPoint.Value = 43 - This.Value- + 1
(Is this not 44 - This.Value ??? )
ThisForm.txtPonit.Refresh()
Return .t.

txtPoint control field shall be set to points field of the table.

Does this answer your point?
Ramani :)
 
ramani,
hey thanks, I tried to do it last night but just did not
have it right i guess, it might have to wait until
the weekend. thanks for pointing me to the valid event firing...also thanks for pointing out 44-this.Value.
can not work on it until then cause I have a test in
C++ Thursday night!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top