Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Format problem
Message
De
07/12/2001 21:23:07
 
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00590977
Message ID:
00591583
Vues:
34
Hi, thank for the advise, below is my MakeLength function code. Please kindly
help to pinpoint my problem

Public Function MakeLength(pvString As String, pvLength As Integer) As String

Dim lLength As Integer
Dim lNo As Integer
Dim lStr As String

lStr = Trim(pvString)
lLength = Len(lStr)

If pvLength <= lLength Then
MakeLength = pvString
Exit Function
End If

lLength = pvLength - lLength
MakeLength = lStr
For lNo = 1 To lLength
MakeLength = MakeLength & " "
Next

End Function


Finally, just like to know can I programmatically use ADO to bound to a combo
box ?

Thank you


>It seems that your MakeLength function is problematic. That's why I was asking for code ( but it should look like MsgBox Left$("112233" + Space$(20), 20) & "44") !
>
>Also, If you want to have "user" correctly aligned, you will need to select a fixed font (like courier).
>
>
>>The Function MakeLength is to output the formated input string to a certain lenght like MakeLength("Test",5), it will give output of "Test ", lenght of 5
>>as I want to format the displaying in combo box.
>>
>>>>Hi,
>>>>
>>>>I am using combo to populate it with data. As I can't had 02 columns of
>>>>display in combo as easily as it can be done in VFP, I had to do the following
>>>>code below
>>>>
>>>>lCode = MakeLength(lCode,20)
>>>>lDisplay = lCode & SPACE(1) & lName
>>>>
>>>>The function Makelength is written by me to make the final return string to be total length of 20 to append with the variable lName hopping to get display
>>>>as show below
>>>>
>>>>12334 user 1
>>>>122233 user 2
>>>>222223333 user 3
>>>>
>>>>But insteads, I get the display below from the combo box
>>>>
>>>>1233 user 1
>>>>122233 user 2
>>>>22222333 user 3
>>>>
>>>>I am loss, please advise me on the above issue why the formating
>>>>is out for me in the combo box.
>>>
>>>And what is the code behind MakeLength ?
Best Regards
Virusim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform