Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF Statement....
Message
 
To
24/10/1998 15:21:03
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00150201
Message ID:
00150417
Views:
10
>HI,
>
>I must be missing something here...sure could use some help.
>THe field FLD! defintley contains the data from the COmboBox LIST field (as viewed in the watch window). However, it just falls through the = condition and I don't understand why.. Here's the simple code:
>
> Private Sub cboAmpChannel_Click()
>Dim fld1 As String
>
>fld1 = Trim(cboAmpChannel.Text)
>
> If Trim(fld1) = "1(Mono)" Then
> chkAmpStereoMonoDrive.Enabled = False
> chkAmpStereoMonoDrive.Refresh
>End If
>
>
>cboampchanne.text is populated when selected by the user and is defined in the List property in this combo box. Is there something about being defined in the List property that causes the field definitions to differ? I can look in the watch window and see that fld1 is = to "1(Mono)", yet it compares unequal. WHY?
>
>Thanks in advance for your response.
>
>Barry

To be considered equal, two strings have to be the same length and have exactly the same characters (case too). The Trim functions is good for clipping blanks. We normally use Ucase (or Lcase) to ensure we have the same case.

Chechk for the length. Maybe some hidden characters!!!
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform