on 11-08-2004 12:57 PM
Hi all:
I want to feel a combobox with the result of a Query, but I can't get the result when I feel it, can any one help me pls.
Here is the code:
dim oprom as sabbouicom.combobox
oRecordset.DoQuery ("SELECT PrjName,PrjCode From OPRJ ")
Set oprom = oForm.Items.Item("11").Specific
oprom.DataBind.SetBound True, "OPRJ", "PrjName"
If oRecordset.RecordCount <> 0 Then
oprom.ValidValues.Add(.Fields.Item("PrjName").Value, .Fields.Item("PrjCode").Value)
End If
End With
Sorry for my post, I wrote it wrong, "Feel a combobox wit a Query", it was fill a combobox with a Query
My problem has solved thank's any way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sébastian:
It was just a syntaxis error:
oRecordset.DoQuery ("SELECT PrjName,PrjCode From OPRJ ")
For i = 0 To oRecordset.RecordCount - 1
If oRecordset.RecordCount <> 0 Then
oprom.ValidValues.Add oRecordset.Fields.Item("PrjName").Value, oRecordset.Fields.Item("PrjName").Value
' oprom.ValidValues.Add(.Fields.Item("PrjName").Value, .Fields.Item("PrjCode").Value)
End If
Next i
when we want to get combo value we must check first if the value selected is empty or not
if oTmpForm.items("47").specific.selected is nothing then
Msgbox("the value is empty")
else
Dim XXX as string [ or integer] depending of the combobox dield
XXX = oTmpForm.items("47").spesific.selected.value
End if
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.