Hello
I’m Trying to load AddRow group Items into a Popup menu selected by RadioButtions
RadioButtonGroup1 Loads Item 1 and Item 2 into the PopupMenu (PopUpMenuGroup)
RadioButtonGroup2 Loads Item 3 and Item 4 into the PopUpMenu (PopUpMenuGroup)
Using the LIKE with the wildcard to filter the groups and not getting the desired result. the RecordSet rs is showing (Below) in debug and is not loading the PopupMenu Items. This is obviously not the right way to do it. I was thinking of using MATCH instead of LIKE. Are there any suggestions of the best way to achieve this simple task?
BOF True
EOF True
FieldCount 2
Dim Group As String
//Table PopupMenuGroup
ID PopupItem ItemGroup
0 Item 1 Group1
1 Item 2 Group1
2 Item 3 Group2
3 Item 4 Group2
If radioButtonGroup1.Value = True Then
Group = "Group1"
ElseIf radioButtonGroup2.Value = True Then
Group = "Group2"
End If
Dim rs as RecordSet
rs = db.SQLSelect("SELECT * FROM PopupMenuGroup WHERE ItemGroup LIKE '"+ Group +"%'" )
if rs <> Nil then //Continue if there is data
PopupMenuGroup.DeleteAllRows
do until rs.EOF //continue until we reach the End Of File
PopupMenuGroup.AddRow rs.Field("PopupItem").StringValue //Add rows of data
PopupMenuGroup.RowTag(PopupMenuGroup.ListCount-1) = rs.Field("ID").IntegerValue //Breaks
rs.MoveNext //move to the next recordset
loop //get the next row of data
If PopupMenuGroup.ListCount <> -1 Then
PopupMenuGroup.Enabled = True
End If
else
MsgBox "No RecordSet exists."
end if