I am not an access expert and I have (I hope!) A simple question ...
I have a form with several entries. In some text blocks, I simply represent the values ββfrom the base table, so they are bound to the corresponding fields.
But some text fields must contain calculated values. Some calculations are complex and contain many fields from the table. I am writing a calculation as a function of VBA. I could enter something like "Control Source":
=MyFunction([Field1], [Field2], [Field3] ...)
But I do not want to list dozens of fields in a function call. Instead, I want to send the entire form (or current record) as a parameter and let the function refer to the fields it needs. I can do it like this:
=MyFunction([Forms]![MyForm])
But I do not like to call a form in a call. There is no way to send the "current form" as an argument to a function? In VBA, you simply use the keyword "I", for example, "I! [Field1]". But it seems that the "I" is not accepted in the expression.
Is there any other way to refer to the current form in an expression?
(This is a cosmetic question, I know, but itβs not very good programming to use β[Form]! [MyForm].β Later you will copy the controls to another form and forget to change the name in the expression ...)
Thank you for your help !:-)
/ Anders
reference ms-access forms
Uglyswede
source share