Select to view content in your preferred language

Combo Box Problem

1521
3
07-27-2011 06:42 PM
SCWONG
by
New Contributor
I am adding the following information to the Combo Box of a Form using additem on ArcPad 10 and set the
objCtr.ListIndex = 17
objCtr.Value = ???1100 ??? 1730???

In WM6.5, it shows a correct value of ???1100 ??? 1730??? onscreen, however the PC version shows a value of ???1300 ??? 2000???.

For those Combo Boxes with alpha elements, it shows correctly in both PC and WM.
Also, the VBS codes have been executed by ArcPad 6 and 7 and no problem occurred.

How can I solve the problem in ArcPad 10?



Elements
--------------
blank                 0
0800 - 1515 1
0815 - 1515 2
0900 - 1200 3
0900 - 1230 4
0900 - 1530 5
0900 - 1600 6
0900 - 1600 7
0900 - 1615 8
0900 - 1700 9
0915 - 1600 10
0930 - 1130 11
0930 - 1530 12
0930 - 1600 13
1000 - 1130 14
1030 - 1730 15
1045 - 1430 16
1100 - 1730 17
1300 - 2000 18
1300 - 2000 19
1300 - 2015 20
--------------

_________
SC Wong
Tags (3)
0 Kudos
3 Replies
AndrewHansford
Occasional Contributor II
I was wondering are you harding coding the values through VB or have you created a list in ArcPAD GUI?

Are you able to show your code for this?

Also i wonder if it would be easier to add the list from the file like txt or dbf, just a thought, or if you are using an AXF file then why not create the table in AXF?

Cheers

I am adding the following information to the Combo Box of a Form using additem on ArcPad 10 and set the
objCtr.ListIndex = 17
objCtr.Value = �??1100 �?? 1730�?�

In WM6.5, it shows a correct value of �??1100 �?? 1730�?� onscreen, however the PC version shows a value of �??1300 �?? 2000�?�.

For those Combo Boxes with alpha elements, it shows correctly in both PC and WM.
Also, the VBS codes have been executed by ArcPad 6 and 7 and no problem occurred.

How can I solve the problem in ArcPad 10?



Elements
--------------
blank                 0
0800 - 1515 1
0815 - 1515 2
0900 - 1200 3
0900 - 1230 4
0900 - 1530 5
0900 - 1600 6
0900 - 1600 7
0900 - 1615 8
0900 - 1700 9
0915 - 1600 10
0930 - 1130 11
0930 - 1530 12
0930 - 1600 13
1000 - 1130 14
1030 - 1730 15
1045 - 1430 16
1100 - 1730 17
1300 - 2000 18
1300 - 2000 19
1300 - 2015 20
--------------

_________
SC Wong
0 Kudos
SCWONG
by
New Contributor
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

******************************************************
0 Kudos
AndrewHansford
Occasional Contributor II
Hi SC,

I had a similar problem with an application that I built in ArcPad 7 (in 2008) and at that stage I did a massive rebuild of the application to incorporate some of the new functionality between 6 and 7.

Unfortunately there appears to be differences in ArcPad 7 and ArcPad 10 (not just isolated to 10.0.2) Were on the device it wasnt calculating my values at the end of my application.

Unfortunately I havent had a chance to investigate this. One would imagine that ESRI has subtly changed something that is causing the error. I would have to say that it is both a bug in the code and the application.

There is no straigh forward check either.

Sorry about this

Regards

Andrew


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

******************************************************
0 Kudos