That subject's a mouthful. I'll try my best here...
I have Form A, which has a sub form on it (Form B). Form B has only one textbox which displays the result of a query. Form C is launched from Form A, and some of the information from Form A populates a textboxes on Form C. This is where the problem occurs.
Form B (the sub form with the query result) populates one textbox on Form C. This works as long as the query returns a record - if it does not I get error 2427 when I try to populate the textbox on Form C.
I can't test if the textbox on Form B is null, because doing so causes the error. This all involves a form and not a report so I can't use On NoData event. The only thing I can think to do is check if the query has any records, and if not skip the VBA code that would populate the textbox on Form C from Form B. I can't figure this out though.
I would want to check the query during the load event of Form C. If the query has no records, I still want to continue, I just don't want to try to populate one of the textboxes on Form C (it can be empty).
Thank you.
I have Form A, which has a sub form on it (Form B). Form B has only one textbox which displays the result of a query. Form C is launched from Form A, and some of the information from Form A populates a textboxes on Form C. This is where the problem occurs.
Form B (the sub form with the query result) populates one textbox on Form C. This works as long as the query returns a record - if it does not I get error 2427 when I try to populate the textbox on Form C.
I can't test if the textbox on Form B is null, because doing so causes the error. This all involves a form and not a report so I can't use On NoData event. The only thing I can think to do is check if the query has any records, and if not skip the VBA code that would populate the textbox on Form C from Form B. I can't figure this out though.
I would want to check the query during the load event of Form C. If the query has no records, I still want to continue, I just don't want to try to populate one of the textboxes on Form C (it can be empty).
Thank you.