This is the last challenge I currently have, and its taken me days to get to this point. I have finally figured out how to make a query that will run some calculations I need. The query is called
qry_hardcopy_ca lcs
In a subfrm I have 2 fields which will run this query and some extra VBA on an event. I will try and explain what needs to happen as clearly as I can, and the controls associated.
subform = subfrm_xmit_doc s
trigger controls = subfrm_xmit_doc s.HC_sent , subfrm_xmit_doc s.CD_sent
linked field = subfrm_xmit_doc s.Path
(subfrm_xmit_do cs.Path = tbl_hardcopies. Filename)
target update table = tbl_hardcopies
target update table fields = tbl_hardcopies. HC_curr , target update table = tbl_hardcopies. CD_curr
ok, the purpose of the code: If I enter a number in to HC_sent and try to go to the next field, it should run "qry_hardcopy_c alcs" and look at the new value in the query field "HC_diff". If the value in "HC_diff" < 0, it should cancel the process and not allow the update to subfrm_xmit_doc s.HC_sent. It should also give a popup warning saying something like "There are not enough hardcopies on file. Add some first."
If the value in "HC_diff" => 0, it would copy the value in "HC_diff" and paste it to the tbl_hardcopies. HC_curr field that corresponds to Filename.
Thats probably as clear as I can explain it. It is a process that compares a numerical value associated with a filename to a calculation value in a query, and if the value is valid it allows it and updates the current qty amount with the new amt. If the value is less than 0, it prevents someone from entering that qty and warns them about it.
qry_hardcopy_ca lcs
In a subfrm I have 2 fields which will run this query and some extra VBA on an event. I will try and explain what needs to happen as clearly as I can, and the controls associated.
subform = subfrm_xmit_doc s
trigger controls = subfrm_xmit_doc s.HC_sent , subfrm_xmit_doc s.CD_sent
linked field = subfrm_xmit_doc s.Path
(subfrm_xmit_do cs.Path = tbl_hardcopies. Filename)
target update table = tbl_hardcopies
target update table fields = tbl_hardcopies. HC_curr , target update table = tbl_hardcopies. CD_curr
ok, the purpose of the code: If I enter a number in to HC_sent and try to go to the next field, it should run "qry_hardcopy_c alcs" and look at the new value in the query field "HC_diff". If the value in "HC_diff" < 0, it should cancel the process and not allow the update to subfrm_xmit_doc s.HC_sent. It should also give a popup warning saying something like "There are not enough hardcopies on file. Add some first."
If the value in "HC_diff" => 0, it would copy the value in "HC_diff" and paste it to the tbl_hardcopies. HC_curr field that corresponds to Filename.
Thats probably as clear as I can explain it. It is a process that compares a numerical value associated with a filename to a calculation value in a query, and if the value is valid it allows it and updates the current qty amount with the new amt. If the value is less than 0, it prevents someone from entering that qty and warns them about it.
Comment