Erroneous parameter value prompt on form close event

MilaK

Registered User.
Local time
Today, 12:30
Joined
Feb 9, 2015
Messages
285
Hello,

I have a main form with sub-form and sub-sub-form. One of the calculated fields that serves as the row source for the sub-sub-form is dependent on a textbox on the sub-form, as reference in the formula below:

Code:
CorrFifty1: IIf(([50%_CI]-2*(1-([Forms]![frm_combined_CNVs_with_Comments]![frm_sample_cnv1].[Form]![cellularity]/100)))/([Forms]![frm_combined_CNVs_with_Comments]![frm_sample_cnv1].[Form]![cellularity]/100)<0,0,([50%_CI]-2*(1-([Forms]![frm_combined_CNVs_with_Comments]![frm_sample_cnv1].[Form]![cellularity]/100)))/([Forms]![frm_combined_CNVs_with_Comments]![frm_sample_cnv1].[Form]![cellularity]/100))

When the user changes the value on the sub-form I use a button to re-query the sub-sub form, based on that value. It seems to work well.

However, when I close the main form I always get a 'enter parameter value' prompt for some reason. Also, Access crashes.
Code:
[Forms]![frm_combined_CNVs_with_Comments]![frm_sample_cnv1].[Form]![cellularity]
Is there a way to prevent this from happening?

Thanks
 
Please see the attached. I took out most of the forms and queries to get it down to 2MB.
Please open "frm_combined_CNVs_with_Comments" and then close to reproduce the error.

Thank you very much,
 

Attachments

Did you actually follow up on the error you got?
Ie. checked if the is a control with the name "cellularity" in the form "frm_sample_cnv1"?
Or did you think, oh I do not get an error in the Iif statement, so there is probably a control called "cellularity" in that form!
 
You are correct the text box was not named "cellularity".

I've changed the control name to txt_cellularity and adjusted all the formulas, but again I get prompted on the closing of the form. Now I'm asked for the value for the "txt_cullularity" text box. Something else is wrong?

I'm attaching the updated database in case someone could help to solve the issue.

I really appreciate your help here. This is a great forum.
 

Attachments

Last edited:
I had a stroke of genius and figured out a solution. :)
 

Users who are viewing this thread

Back
Top Bottom