I have a form called MAIN_FORM2 on which there are the following subforms
Company form based on a table called company
Company_site_form based on a table called sites
Job_lifts1_form based on tables called jobs and job_lifts.
The forms work fine saving and displaying the data entered via the forms but I need to update the job-lifts table with the fee due to employees selected from the combo boxes who completed the job lift.
I have set up a command button which runs an update query
UPDATE job_lifts SET rigger1_fee = ([charge]*0.6), labourer1_fee = ([charge]*0.4)
WHERE ((([job_lifts].[rigger1]) Is Not Null) And (([job_lifts].[labourer1]) Is Not Null)) And [job_lifts].[job_no]=[forms]![company_form].[forms]![company_site_form].[job_lifts1_form]![job_no] And [job_lifts].[job_lift_id]=[forms]![job_lifts1_form]![job_lift_id];[/I]
Other queries are used where the rigger/labourer ratio is different but use the same forms referencing.
When I run the query from the form job_lifts1_form it appears to work ok but when run from MAIN_FORM2 I am prompted for the job_no and job_lift_id
I believe the problem lies with the subform referencing in the update query.
I am hoping the answer can be found to what is no doubt a very simple problem.
Company form based on a table called company
Company_site_form based on a table called sites
Job_lifts1_form based on tables called jobs and job_lifts.
The forms work fine saving and displaying the data entered via the forms but I need to update the job-lifts table with the fee due to employees selected from the combo boxes who completed the job lift.
I have set up a command button which runs an update query
UPDATE job_lifts SET rigger1_fee = ([charge]*0.6), labourer1_fee = ([charge]*0.4)
WHERE ((([job_lifts].[rigger1]) Is Not Null) And (([job_lifts].[labourer1]) Is Not Null)) And [job_lifts].[job_no]=[forms]![company_form].[forms]![company_site_form].[job_lifts1_form]![job_no] And [job_lifts].[job_lift_id]=[forms]![job_lifts1_form]![job_lift_id];[/I]
Other queries are used where the rigger/labourer ratio is different but use the same forms referencing.
When I run the query from the form job_lifts1_form it appears to work ok but when run from MAIN_FORM2 I am prompted for the job_no and job_lift_id
I believe the problem lies with the subform referencing in the update query.
I am hoping the answer can be found to what is no doubt a very simple problem.