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

Function, sub or? and how?

Status
Not open for further replies.

karassik

Technical User
Mar 27, 2002
51
US
I am trying to calculate records within a subform with records in the parent form and records from outside the form query (in another table), but I'm not sure how to exactly go about it.

scenario:

Parent form: Leadwage, Bidhours

Subform: employeeName, hours

Outside table: employeeName, wage
I need to call out a function or subroutine which can compare the employees wage (in another table not in this forms query) to the leadwage and if it is less, do a calcuation, then store that information in the Hours table, which is not in the form query.

How do I call out the function/sub (on exit of subform?), then how do I get the hours information into the function/sub? Also, how do I do the comparision/ calculation for each of the subform records?

Thank you for all your help. I hope I have been clear.

Nishan
 
You can use the function DLookUp("FieldName","TableName","Criteria") to get a value from another table or query that is not bound to either the form or the subform.

You can use currentdb.Execute "Update/Insert Query Statement" to update or insert to store it in the hours table.

More details on how to do what you want will probably need more details on what you are trying to do.

I hope this points you in the right direction.
Pat B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top