Hi, Andrew. Thanks for your advice. The application has been developed in 2002 and successfully run on ArcPad 6 and 7. Unfortunately, it appears abnormally in ArcPad 10.0.2 (PC Version only). I just want to know whether it is a bug of ArcPad. If affirmative, I do not have to waste my time to refine the program codes.
I observed that it appears on combobox that all items have no alpha char. If I added an item with alpha char, the combobox showed correct value.
SC
Program codes:
******************************************************
Sub SetComboBox(objCtr, mValue, mFieldName, mSQL, mBlank)
Dim condb
Dim objRS
Dim mCount
Dim mListIndex
Dim mData
Set condb = CreateObject(gtxtConnection)
condb.ConnectionString = gstrConn
condb.Open
Set objRS = CreateObject(gtxtRecordset)
objRS.Open mSQL, condb, 1
mCount = 0
mListIndex = -1
mValue = Trim(DefVal(mValue, ""))
If mValue = mBlank Then mListIndex = 0
Call objCtr.Clear
Call objCtr.AddItem(mBlank, mBlank)
Do While (Not objRS.EOF)
mCount = mCount + 1
mData = Trim(DefVal_Str(objRS.Fields(mFieldName).Value, mBlank))
If (mListIndex < 0) And (mValue = mData) Then mListIndex = mCount
Call objCtr.AddItem(mData, mData)
objRS.MoveNext
Loop
If (mListIndex < 0) And (mValue <> mBlank) Then
Call objCtr.AddItem(mValue, mValue)
mListIndex = mCount + 1
End If
objCtr.ListIndex = mListIndex
objCtr.Value = mValue
objRS.Close
Set condb = Nothing
Set objRS = Nothing
End Sub
******************************************************