tranchemontaigne
Registered User.
- Local time
- Today, 14:17
- Joined
- Aug 12, 2008
- Messages
- 203
I have never figured out how to calculate the name of a control and the use that calculated name to assign a value. Is this possible in MS Access 2000?
Pseudocode emulating the behavior of an option group or control array when a form is loaded is listed below.
Please consider "'t06_PHIN_System_Integrity" as a valid table field name to be passed to this function.
I am fully aware that this pseudocode fails to assign a value to a calculated control name because all it does is assign a value to a variable, then assign a second value to the same variable.
Any thoughts would be greatly appreciated.
________
Silver surfer vaporizer
Pseudocode emulating the behavior of an option group or control array when a form is loaded is listed below.
Please consider "'t06_PHIN_System_Integrity" as a valid table field name to be passed to this function.
Private Function fn_PHIN_rdo_Buttons(strTableField As String)
'//16 Jan 2009
Dim strControlValue As String
Dim strControlNameYes As String
Dim strControlNameNo As String
Dim strControlNameUnk As String
strControlValue = "me![" & strTableField & "].value"
strControlNameYes = "Me![rdo" & Mid(strTableField, 10, 99) & "_Yes].value"
strControlNameNo = "Me![rdo" & Mid(strTableField, 10, 99) & "_No].value"
strControlNameUnk = "Me![rdo" & Mid(strTableField, 10, 99) & "_Unk].value"
Select Case strControlValue
Case "Y"
strControlNameYes = -1
strControlNameNo = 0
strControlNameUnk = 0
Case "N"
strControlNameYes = 0
strControlNameNo = -1
strControlNameUnk = 0
Case "U"
strControlNameYes = 0
strControlNameNo = 0
strControlNameUnk = -1
End Select
End Function
I am fully aware that this pseudocode fails to assign a value to a calculated control name because all it does is assign a value to a variable, then assign a second value to the same variable.
Any thoughts would be greatly appreciated.
________
Silver surfer vaporizer
Last edited: