I have a form with a subform, the subform contains several fields that are summed in a textbox [Text14]. The form has a second subform that the user types amounts to reduce stocks by, these fields are summed in a textbox [Text20]
If the totals in the two boxes are not the same, I need a message saying so, and stop the form from closing till they are equal, only when equal can the form be closed.
I have the following code, without the messagebox, where does it go ? Forgive me if this is simple, I am new to VB and a steep learning curve is envisioned.
If [frm_repel_produced_sub].[Form]![Text14] <> [frm_reduce_stocks_sub].[Form]![Text20] Then DoCmd.CancelEvent Else If [frm_repel_produced_sub].[Form]![Text14] = [frm_reduce_stocks_sub].[Form]![Text20] Then DoCmd.Close , "frm_reduce_stocks"
TIA.
Dave
If the totals in the two boxes are not the same, I need a message saying so, and stop the form from closing till they are equal, only when equal can the form be closed.
I have the following code, without the messagebox, where does it go ? Forgive me if this is simple, I am new to VB and a steep learning curve is envisioned.
If [frm_repel_produced_sub].[Form]![Text14] <> [frm_reduce_stocks_sub].[Form]![Text20] Then DoCmd.CancelEvent Else If [frm_repel_produced_sub].[Form]![Text14] = [frm_reduce_stocks_sub].[Form]![Text20] Then DoCmd.Close , "frm_reduce_stocks"
TIA.
Dave
Last edited: