Dana McD Posted April 20, 2005 Posted April 20, 2005 Hopefully I'm missing something easy here. I want to get and use the current "FieldName" in the Define Fields as a Calculation. I want the calculation to run some logic depending on what the field name is. If I change the field name, in Define Fields, then the calculation may run some different logic. Does that make sense. I'm aware of Get ( ActiveFieldName ) but the field has to be on a layout with a cursor in it. Also the FieldNames(...) function only gets all the fieldnames and not just the one that is crunching the current calculation. Hopefully it is simple like an "=" sign or something and the calculation will return the "FieldName"... I can probably figure another way to do what I want to do, but getting the fieldname in this particular project would be the cleanest way. Thanks Dana
comment Posted April 20, 2005 Posted April 20, 2005 If I understand correctly, you want the result of a calculation to depend on the name of the calculation field where the calculation resides? If so, the short answer is no. The long answer is what for? After all, as you say, you would need to go to Define Fields in order to change the field's name. While you're there, you can change the formula as well. So what would be the purpose? There are many ways to make the result of a calculation dynamic, but this is not one of them.
Dana McD Posted April 21, 2005 Author Posted April 21, 2005 Your correct. It would be similar to Get(CalculationRepetitionNumber) except would be named "Get(CalculationFieldName)". If this would be for one field, then yes it would not be worth it. I could just change the calculation the same time as when I change the field name. In this particular project I have a table that has about 150 fields with similar names. I wanted to create the same calculation and copy into each field but the result would be based on the field name. One step further I was going to create a custom function that accepts the field name as the parameter and returns the result based on the field name. That way if I had to change the calculation I could just change it in the Custom Function and it would automatically affect all 150 fields. All well, I've already started to do this a different way... but Get(CalculationFieldName) would have made this much easier. Thanks Dana
anothersmurf Posted May 21, 2009 Posted May 21, 2009 I'm in a similar situation, I wish there were a get(calculationfieldname). My situation is that I have fields named the same way in 3 DBs, and depending on which index field is filled in, I want to get the contents of the field from DB1 or DB2. Of course there are other ways to get the results I need, but calculationfieldname would be much easier to implement across many fields.
Recommended Posts
This topic is 5724 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now