Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Standing on librebel's shoulders. I could finally solve my problem. Actually, it's simpler than you told me, librebel!

def set_FormControl_Value( oForm, strControlname, myvalue ):
"""
    Sets the Value of the specified control. If the control is formatted,
    then it will take care of the formatting
    You only have to give it a myvalue of the right type.
    For example, if strControlname is a Currency field, 
    myvalue has to be a Float. 
"""
if oForm:
    oCtrlModel = oForm.getByName( strControlname  )
    if oCtrlModel:
        oCtrlModel.Value = myvalue