|
-
Sep 2nd, 2011, 11:45 AM
#1
Thread Starter
Lively Member
[RESOLVED] Value of a fixed string
I am trying to determine if there is any value in a fixed length string.
Given the following:
Dim Data As String * 25
Dim NewData As String
If I try the following 2 statements I get a type mismatch error
If Data = vbNull Then Debug.Print "Y" Else Debug.Print "N"
If Data = vbEmpty Then Debug.Print "Y" Else Debug.Print "N"
I have tried all of the following without success.
If Data = "" Then Debug.Print "Y" Else Debug.Print "N"
If Data = " " Then Debug.Print "Y" Else Debug.Print "N"
If Data = Space(25) Then Debug.Print "Y" Else Debug.Print "N"
If Trim(Data) = "" Then Debug.Print "Y" Else Debug.Print "N"
If Len(Trim(Data)) = 0 Then Debug.Print "Y" Else Debug.Print "N"
If Data = Null Then Debug.Print "Y" Else Debug.Print "N"
If Data = Empty Then Debug.Print "Y" Else Debug.Print "N"
NewData = Trim(Data)
If NewData = Empty Then Debug.Print "Y" Else Debug.Print "N"
If Left(NewData, 1) = " " Then Debug.Print "Y" Else Debug.Print "N"
If NewData = Space(25) Then Debug.Print "Y" Else Debug.Print "N"
What am I obviously missing??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|