KatherineF
Technical User
I am wondering what will be a good way to change the function to populate combobox (add a default value to be selected). The function I have now is used a lot within an application. Since VBScript does not support optional arguments to be passed to a function I don't want to break a lot of pages. So there are 2 functions in my library that have been used for populating a combobox: ComboEdit and ComboEditRS
Function ComboEdit(cCboSql, cName, oFld, oUpdRes, iID)
Dim oRS
On Error Resume Next
' Open a connection
OpenConn oConn
oResult = TableOpen(oConn, oRS, cCboSql, lib_ReadOnlyData)
' Detect and process error
If IsGoodStr(oResult) Then
ErrorDisplay oResult & " (" & oFld.Name & ")"
End If
' Open a combo by RS
ComboEditRS oRS, 0, 1, cName, oFld, oUpdRes, iID
End Function
ComboEditRS Function handles the html part.
I need to pass extra parameter - defaultvalue to be selected - to both of these functions. What is the right way to do this? Thank you!
Function ComboEdit(cCboSql, cName, oFld, oUpdRes, iID)
Dim oRS
On Error Resume Next
' Open a connection
OpenConn oConn
oResult = TableOpen(oConn, oRS, cCboSql, lib_ReadOnlyData)
' Detect and process error
If IsGoodStr(oResult) Then
ErrorDisplay oResult & " (" & oFld.Name & ")"
End If
' Open a combo by RS
ComboEditRS oRS, 0, 1, cName, oFld, oUpdRes, iID
End Function
ComboEditRS Function handles the html part.
I need to pass extra parameter - defaultvalue to be selected - to both of these functions. What is the right way to do this? Thank you!