![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a solution with fields m01, m02,...m12. Each fields contains either "Yes" or "No." Every month I need to change the field for that month (i.e. m12 for December) to "No." I want a script that I can run at the beginning of each month to automatically do this. I can calculate the field name for the current month, but I don't know how to use it as the field name I want to change. I hope this makes sense. Thanks, Rich |
#3
| |||
| |||
|
|
There's no using a calculation to tell FM which field to act on or go to. Any script step you could use to effect a change in the value of a field requires specifying the field directly in the dialog. Thus, it's nothing but brute force scripting: If [ Month ( Get ( CurrentDate ) ) = 1 ] Set Field [ SomeTable::M1 [ "No" ] ] Else If [ Month ( Get ( CurrentDate ) ) = 2 ] Set Field [ SomeTable::M2 [ "No" ] ] Else If [ Month ( Get ( CurrentDate ) ) = 3 ] Set Field [ SomeTable::M3 [ "No" ] ] etc., etc., etc. End If Clunky, but it will do the job. Matt On 12/30/2006 20:17:03 rich.sagall (AT) pobox (DOT) com (Rich Sagall) wrote: I have a solution with fields m01, m02,...m12. Each fields contains either "Yes" or "No." Every month I need to change the field for that month (i.e. m12 for December) to "No." I want a script that I can run at the beginning of each month to automatically do this. I can calculate the field name for the current month, but I don't know how to use it as the field name I want to change. I hope this makes sense. Thanks, Rich |
#4
| |||
| |||
|
|
That's what I was afraid of. Thanks Matt Wills <Im (AT) witz (DOT) end> wrote: There's no using a calculation to tell FM which field to act on or go to. Any script step you could use to effect a change in the value of a field requires specifying the field directly in the dialog. Thus, it's nothing but brute force scripting: If [ Month ( Get ( CurrentDate ) ) = 1 ] Set Field [ SomeTable::M1 [ "No" ] ] Else If [ Month ( Get ( CurrentDate ) ) = 2 ] Set Field [ SomeTable::M2 [ "No" ] ] Else If [ Month ( Get ( CurrentDate ) ) = 3 ] Set Field [ SomeTable::M3 [ "No" ] ] etc., etc., etc. End If Clunky, but it will do the job. Matt On 12/30/2006 20:17:03 rich.sagall (AT) pobox (DOT) com (Rich Sagall) wrote: I have a solution with fields m01, m02,...m12. Each fields contains either "Yes" or "No." Every month I need to change the field for that month (i.e. m12 for December) to "No." I want a script that I can run at the beginning of each month to automatically do this. I can calculate the field name for the current month, but I don't know how to use it as the field name I want to change. I hope this makes sense. Thanks, Rich |
#5
| |||
| |||
|
|
There's no using a calculation to tell FM which field to act on or go to. Any script step you could use to effect a change in the value of a field requires specifying the field directly in the dialog. Thus, it's nothing but brute force scripting: If [ Month ( Get ( CurrentDate ) ) = 1 ] Set Field [ SomeTable::M1 [ "No" ] ] Else If [ Month ( Get ( CurrentDate ) ) = 2 ] Set Field [ SomeTable::M2 [ "No" ] ] Else If [ Month ( Get ( CurrentDate ) ) = 3 ] Set Field [ SomeTable::M3 [ "No" ] ] etc., etc., etc. End If Clunky, but it will do the job. Matt On 12/30/2006 20:17:03 rich.sagall (AT) pobox (DOT) com (Rich Sagall) wrote: I have a solution with fields m01, m02,...m12. Each fields contains either "Yes" or "No." Every month I need to change the field for that month (i.e. m12 for December) to "No." I want a script that I can run at the beginning of each month to automatically do this. I can calculate the field name for the current month, but I don't know how to use it as the field name I want to change. I hope this makes sense. Thanks, Rich |
#6
| |||
| |||
|
|
I have a solution with fields m01, m02,...m12. Each fields contains either "Yes" or "No." Every month I need to change the field for that month (i.e. m12 for December) to "No." I want a script that I can run at the beginning of each month to automatically do this. I can calculate the field name for the current month, but I don't know how to use it as the field name I want to change. I hope this makes sense. Thanks, Rich |
![]() |
| Thread Tools | |
| Display Modes | |
| |