I have a unbound control on a form which is trying to reference a subform i.e. =[subform name].[Form]![ID field]
if there are no records it shows #error
I want it to show 0
If the subform is bound to a table or query why not check the recordcount of the subform before assigning the variable. If it it 0 then set the variable to 0.
The reason you are getting the error is because your query behind your subform is not updatable. If it was and returned no records the field would be blank rather than #error. If you must use this non-updatable query checking for null will not work because the field in the query does not exist. An updatable query would at least show a new record row so the field exist It's just null)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.