Morning !
I have made a continues subform (frmA) on my main form (frmMainA) with an button on it. In the clickevent I have made some statements to run eventually a delete query. There is also another subform (frmB > which is linked to frmA by frmMainA). Now I want to make a If statement that the event is only happening when an iffcount value in frmB is > 0. I have tried to create this by making a new linked text box (txtCheck) on frmMainA and then refer to that value.
Summary: Basically I want to check an IIFCOUNT in another subform and if this is > 0 it is not allowed to delete the records in frmA, since there are corresponding records in frmB.
The problem: When I am for example on record 2 of frmA and select the button of record e.g. 10 frmA (launch delete query), the value of txtCheck displays the value of frmB linked to record 2 of frmA, since the click event is launched before selecting the record 10.
Question: Is there a easy way to first select the record on frmA and then launch the click event of this button?
Thank you for support!
I have made a continues subform (frmA) on my main form (frmMainA) with an button on it. In the clickevent I have made some statements to run eventually a delete query. There is also another subform (frmB > which is linked to frmA by frmMainA). Now I want to make a If statement that the event is only happening when an iffcount value in frmB is > 0. I have tried to create this by making a new linked text box (txtCheck) on frmMainA and then refer to that value.
Summary: Basically I want to check an IIFCOUNT in another subform and if this is > 0 it is not allowed to delete the records in frmA, since there are corresponding records in frmB.
The problem: When I am for example on record 2 of frmA and select the button of record e.g. 10 frmA (launch delete query), the value of txtCheck displays the value of frmB linked to record 2 of frmA, since the click event is launched before selecting the record 10.
Question: Is there a easy way to first select the record on frmA and then launch the click event of this button?
Thank you for support!