I am relatively new to ADPs and Access development. I am creating an appl to track industrial shipments. When a truck comes onsite, 2 weights are recorded..an Incoming(full) weight and an Outgoing(empty) weight.
I have a table named SCALE_READINGS to store Incoming/ Outgoing weights for each truck. 1 truck ends up 2 weight entries to form a complete record.
I have not been able to figure out a way to run a query behind the scenes to check the SCALE_READINGS table when a user selects the record button to insert a new entry. I have written a stored procedure accepting the TruckId and WeightType(In/Out) parameters chosen on a form which featurs a SELECT COUNT statement to determine if there is a previous entry of that weight type for a truck. A value of '1' means YES.
But I am not sure how to tie this query which works great when run manually to a hidden control on the main form. I have been experimenting with the different DoCmd options(RunSQL, OpenStoredProcedure, OpenQuery) to no avail.
Can someone give me any pointers? If the returned count is 1, I want to present the user with a MsgBox making sure they want to overwrite the previous record.
Any help would be appreciated!
I have a table named SCALE_READINGS to store Incoming/ Outgoing weights for each truck. 1 truck ends up 2 weight entries to form a complete record.
I have not been able to figure out a way to run a query behind the scenes to check the SCALE_READINGS table when a user selects the record button to insert a new entry. I have written a stored procedure accepting the TruckId and WeightType(In/Out) parameters chosen on a form which featurs a SELECT COUNT statement to determine if there is a previous entry of that weight type for a truck. A value of '1' means YES.
But I am not sure how to tie this query which works great when run manually to a hidden control on the main form. I have been experimenting with the different DoCmd options(RunSQL, OpenStoredProcedure, OpenQuery) to no avail.
Can someone give me any pointers? If the returned count is 1, I want to present the user with a MsgBox making sure they want to overwrite the previous record.
Any help would be appreciated!