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

have a form submit to itself

Status
Not open for further replies.

kiwieur

Technical User
Apr 25, 2006
200
GB
Hi,

I have a form that includes the following

CallNo = ReadOnly
Elapsed Time = ReadOnly
Current Cost = ReadOnly
Updated Time = ReadOnly
New Time

The First 3 read only files are populated from a recordset, when the user enters data into the "new time" field the "updated Time" field is clculated from "elapsed Time" + "New Time".

The "current Cost" is based on how much time has been taken to fulfill the project i.e.

1 hour = £30
2 hours = £35
3 hours = £40
etc

Therefore it would be nice once the updated time field is calculated to get the updated current price from the DB before submitting the data.

Currently I submit this back to the DB however the "Current Cost" field is not updated until the form is re-opened and the value populated from the recordset.

I know i have not explained this very well but if anyone can help it would be much appreciated


Regards

Paul

 
You can't go back to the DB without submitting the page. However, if you have a set list of prices for your current costs, you can keep them in an array that is available on the client side that you can then reference once the "new time" field has been updated. Then, you can simply update the "updated time" field along with the "current cost" field with some client-side code.

Otherwise (at least insofar as I understand your problem based on your description), you would have to submit your form twice in order to retrieve your "current cost" data and then be able to update the database after that point. Or, you could retrieve your current cost information when you submit by structuring your SQL code correctly. But that would necessitate you posting some of the relevant code.

If this doesn't help, post back with a better explanation (sorry, but your post above is a little confusing to me) and we'll work from there.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top